adding api changes to error properly

This commit is contained in:
talksik
2022-03-17 23:24:05 -04:00
parent 4d0a75af6e
commit 9613e2b2cf
3 changed files with 22 additions and 25 deletions
+5 -11
View File
@@ -42,19 +42,13 @@ class NirvanaApi {
user = {
async getUserDetails(): Promise<User> {
return await (
await fetch(localHost + `/users`, {
method: "GET",
headers: { Authorization: this._authToken },
})
).json();
return await axios.get(localHost + `/users`, {
headers: { Authorization: this._authToken },
});
},
async createUser(accessToken: string) {
return await fetch(
localHost + `/users/create?access_token=${accessToken}`,
{
method: "POST",
}
return await axios.post(
localHost + `/users/create?access_token=${accessToken}`
);
},
};