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:
parent
8705c8d143
commit
f707ac505f
2 changed files with 14 additions and 5 deletions
|
|
@ -261,9 +261,7 @@ const SummonGrid = (props: Props) => {
|
|||
|
||||
try {
|
||||
if (stage != previousTranscendenceStages[position])
|
||||
await api.endpoints.grid_summons
|
||||
.update(id, payload)
|
||||
.then((response) => {
|
||||
await api.updateTranscendence('summon', id, stage).then((response) => {
|
||||
storeGridSummon(response.data.grid_summon)
|
||||
})
|
||||
} catch (error) {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue