Add verification endpoint

This commit is contained in:
KillerBossOriginal 2023-12-09 14:14:19 +01:00
parent 84870e7e9e
commit c8f959bf8e
2 changed files with 6 additions and 7 deletions

View file

@ -27,9 +27,12 @@ export default class CreditsManager {
* @param {number} id - The ID to set.
* @return {Promise<number>} - 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}` } });
}
}

View file

@ -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": "" });
}
}