Update api.tsx
This commit is contained in:
parent
4f361ff081
commit
775188ea19
1 changed files with 2 additions and 4 deletions
|
|
@ -1,7 +1,5 @@
|
||||||
import axios, { AxiosRequestConfig, AxiosResponse } from "axios"
|
import axios, { AxiosRequestConfig, AxiosResponse } from "axios"
|
||||||
|
|
||||||
const { REACT_APP_SIERO_API_URL, REACT_APP_SIERO_OAUTH_URL } = process.env
|
|
||||||
|
|
||||||
interface Entity {
|
interface Entity {
|
||||||
name: string
|
name: string
|
||||||
}
|
}
|
||||||
|
|
@ -48,7 +46,7 @@ class Api {
|
||||||
}
|
}
|
||||||
|
|
||||||
login(object: {}) {
|
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) {
|
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: 'users' })
|
||||||
api.createEntity( { name: 'parties' })
|
api.createEntity( { name: 'parties' })
|
||||||
api.createEntity( { name: 'characters' })
|
api.createEntity( { name: 'characters' })
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue