diff --git a/components/summon/SummonGrid/index.tsx b/components/summon/SummonGrid/index.tsx index 565a5aa9..c0373c67 100644 --- a/components/summon/SummonGrid/index.tsx +++ b/components/summon/SummonGrid/index.tsx @@ -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) diff --git a/utils/api.tsx b/utils/api.tsx index bd55cd0b..63ac5ba4 100644 --- a/utils/api.tsx +++ b/utils/api.tsx @@ -179,6 +179,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}`