Add endpoint for updating uncap levels
This commit is contained in:
parent
8944c461a9
commit
86657e133a
1 changed files with 11 additions and 1 deletions
|
|
@ -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'})
|
||||
|
|
|
|||
Loading…
Reference in a new issue