Fix summon transcendence

Summon transcendence was doing something wonky. This adapts the updateUncap endpoint method to make it a little bit clearer whats going on.
This commit is contained in:
Justin Edmund 2023-07-06 15:52:32 -07:00
parent 8705c8d143
commit f707ac505f
2 changed files with 14 additions and 5 deletions

View file

@ -261,11 +261,9 @@ const SummonGrid = (props: Props) => {
try {
if (stage != previousTranscendenceStages[position])
await api.endpoints.grid_summons
.update(id, payload)
.then((response) => {
storeGridSummon(response.data.grid_summon)
})
await api.updateTranscendence('summon', id, stage).then((response) => {
storeGridSummon(response.data.grid_summon)
})
} catch (error) {
console.error(error)

View file

@ -180,6 +180,17 @@ class Api {
})
}
updateTranscendence(resource: 'character'|'summon', id: string, value: number) {
const pluralized = resource + 's'
const resourceUrl = `${this.url}/${pluralized}/update_uncap`
return axios.post(resourceUrl, {
[resource]: {
id: id,
transcendence_step: value
}
})
}
userInfo(id: string) {
const resourceUrl = `${this.url}/users/info/${id}`
return axios.get(resourceUrl)