mirror of
https://github.com/lemeow125/React-NotesApp.git
synced 2025-05-16 11:28:17 +08:00
Added user info api
This commit is contained in:
parent
5a34617d77
commit
36f1e3683e
3 changed files with 128 additions and 0 deletions
|
@ -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");
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue