Add endpoint for updating uncap levels

This commit is contained in:
Justin Edmund 2022-02-01 05:03:12 -08:00
parent 8944c461a9
commit 86657e133a

View file

@ -58,12 +58,22 @@ class Api {
return axios.get(url)
}
check(resource: string, value: string) {
check(resource: 'username'|'email', value: string) {
const resourceUrl = `${this.url}/check/${resource}`
return axios.post(resourceUrl, {
[resource]: value
})
}
updateUncap(resource: 'characters'|'weapons'|'summons', id: string, value: number) {
const resourceUrl = `${this.url}/${resource}/update_uncap`
return axios.post(resourceUrl, {
[resource]: {
id: id,
uncap_level: value
}
})
}
}
const api: Api = new Api({ url: process.env.NEXT_PUBLIC_SIERO_API_URL || 'https://localhost:3000/api/v1'})