From c8f959bf8e16db91f93d9def54be03e43c221c88 Mon Sep 17 00:00:00 2001 From: KillerBossOriginal Date: Sat, 9 Dec 2023 14:14:19 +0100 Subject: [PATCH] Add verification endpoint --- src/CreditsManager.ts | 9 ++++++--- src/IAManager.ts | 4 ---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/CreditsManager.ts b/src/CreditsManager.ts index 857a650..baea11a 100644 --- a/src/CreditsManager.ts +++ b/src/CreditsManager.ts @@ -27,9 +27,12 @@ export default class CreditsManager { * @param {number} id - The ID to set. * @return {Promise} - The credits of the user. */ - async set(id: number) { - let req = await axios.post(`${this.URL}/credits/${id}`); + async set(id: number, number: number) { + let req = await axios.post(`${this.URL}/credits/${id}`, { number }, { headers: { Authorization: `Bearer ${this.token}` } }); if (req.status == 404) throw new Error("User not Found"); - return req.data.credits; + } + + async verify(code: number) { + await axios.get(`${this.URL}/credits/verify/${code}`, { headers: { Authorization: `Bearer ${this.token}` } }); } } \ No newline at end of file diff --git a/src/IAManager.ts b/src/IAManager.ts index 27f83e0..8271f36 100644 --- a/src/IAManager.ts +++ b/src/IAManager.ts @@ -14,8 +14,4 @@ export default class IAManager { if (req.status == 404) throw new Error("User not Found"); return req.data; } - - async verify(code: number, identifier: any) { - await axios.post(`${this.URL}/IA/verify/${code}`, { "identifier": "" }); - } } \ No newline at end of file