From 775188ea19bcd9e1a6344f935ef9a460d18a6900 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 29 Jan 2022 20:31:27 -0800 Subject: [PATCH] Update api.tsx --- utils/api.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/utils/api.tsx b/utils/api.tsx index 5547e485..f41b8363 100644 --- a/utils/api.tsx +++ b/utils/api.tsx @@ -1,7 +1,5 @@ import axios, { AxiosRequestConfig, AxiosResponse } from "axios" -const { REACT_APP_SIERO_API_URL, REACT_APP_SIERO_OAUTH_URL } = process.env - interface Entity { name: string } @@ -48,7 +46,7 @@ class Api { } login(object: {}) { - return axios.post(`${ REACT_APP_SIERO_OAUTH_URL || 'http://127.0.0.1:3000/oauth' }/token`, object) + return axios.post(`${ process.env.REACT_APP_SIERO_OAUTH_URL }/token`, object) } search(object: string, query: string, excludes: string) { @@ -67,7 +65,7 @@ class Api { } } -const api: Api = new Api({ url: REACT_APP_SIERO_API_URL || 'http://127.0.0.1:3000/api/v1' }) +const api: Api = new Api({ url: process.env.REACT_APP_SIERO_API_URL }) api.createEntity( { name: 'users' }) api.createEntity( { name: 'parties' }) api.createEntity( { name: 'characters' })