Add verification endpoint
This commit is contained in:
parent
84870e7e9e
commit
c8f959bf8e
2 changed files with 6 additions and 7 deletions
|
@ -27,9 +27,12 @@ export default class CreditsManager {
|
||||||
* @param {number} id - The ID to set.
|
* @param {number} id - The ID to set.
|
||||||
* @return {Promise<number>} - The credits of the user.
|
* @return {Promise<number>} - The credits of the user.
|
||||||
*/
|
*/
|
||||||
async set(id: number) {
|
async set(id: number, number: number) {
|
||||||
let req = await axios.post(`${this.URL}/credits/${id}`);
|
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");
|
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}` } });
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -14,8 +14,4 @@ export default class IAManager {
|
||||||
if (req.status == 404) throw new Error("User not Found");
|
if (req.status == 404) throw new Error("User not Found");
|
||||||
return req.data;
|
return req.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async verify(code: number, identifier: any) {
|
|
||||||
await axios.post(`${this.URL}/IA/verify/${code}`, { "identifier": "" });
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue