Update api.tsx

Add resource to check whether usernames and emails exist
This commit is contained in:
Justin Edmund 2020-09-25 03:38:53 -07:00
parent 1cb7509299
commit 51f0dbce32

View file

@ -45,11 +45,17 @@ class Api {
} as EndpointMap
}
search(query: string) {
const resourceUrl = `${this.url}/${name}`
return axios.get(`${resourceUrl}/search?query=${query}`)
}
check(resource: string, value: string) {
const resourceUrl = `${this.url}/check/${resource}`
return axios.post(resourceUrl, {
[resource]: value
})
}
}
const api: Api = new Api({ url: process.env.SIERO_API_URL || 'http://127.0.0.1:3000/api/v1' })