From 86657e133a5f4131fda305d29617efa655a302cd Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 1 Feb 2022 05:03:12 -0800 Subject: [PATCH] Add endpoint for updating uncap levels --- utils/api.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/utils/api.tsx b/utils/api.tsx index a5490811..60fd68f3 100644 --- a/utils/api.tsx +++ b/utils/api.tsx @@ -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'})