feat: edit state, help button, loader while login in

This commit is contained in:
Dakshesh Jain 2022-11-24 20:23:50 +05:30
parent 97544c1760
commit b28dbaea30
8 changed files with 83 additions and 57 deletions

View file

@ -27,11 +27,13 @@ class UserService extends APIService {
}
async currentUser(): Promise<any> {
if (!this.getAccessToken()) return null;
return this.get(USER_ENDPOINT)
.then((response) => {
return response?.data;
})
.catch((error) => {
this.purgeAccessToken();
throw error?.response?.data;
});
}