Added user info api

This commit is contained in:
Keannu Christian Bernasol 2023-02-26 00:22:17 +08:00
parent 5a34617d77
commit 36f1e3683e
3 changed files with 128 additions and 0 deletions

View file

@ -40,3 +40,18 @@ export function UserLogin(user: user) {
return false;
});
}
export function UserInfo() {
return axios
.get("http://localhost:8000/api/v1/accounts/users/me/", {
headers: { Authorization: "Bearer " + "Token hereee!" },
})
.then((response) => {
if (response.data) {
return response.data;
}
})
.catch((error) => {
console.log("Error in fetching user data");
});
}