Update api.tsx

This commit is contained in:
Justin Edmund 2022-01-29 20:35:23 -08:00
parent 775188ea19
commit 27a774aed7

View file

@ -46,7 +46,8 @@ class Api {
}
login(object: {}) {
return axios.post(`${ process.env.REACT_APP_SIERO_OAUTH_URL }/token`, object)
const oauthUrl = (process.env.REACT_APP_SIERO_OAUTH_URL) ? process.env.REACT_APP_SIERO_OAUTH_URL : 'http://127.0.0.1:3000/oauth'
return axios.post(`${ oauthUrl }/token`, object)
}
search(object: string, query: string, excludes: string) {
@ -65,7 +66,8 @@ class Api {
}
}
const api: Api = new Api({ url: process.env.REACT_APP_SIERO_API_URL })
const apiUrl = (process.env.REACT_APP_SIERO_API_URL) ? process.env.REACT_APP_SIERO_API_URL : 'http://127.0.0.1:3000/api/v1'
const api: Api = new Api({ url: apiUrl })
api.createEntity( { name: 'users' })
api.createEntity( { name: 'parties' })
api.createEntity( { name: 'characters' })