Can update profile information
This commit is contained in:
@@ -47,8 +47,7 @@ export class APIClient {
|
||||
// Handle expired tokens
|
||||
if (res.status === 412) {
|
||||
AuthApi.RemoveAuthToken();
|
||||
// eslint-disable-next-line no-self-assign
|
||||
window.location.href = window.location.href;
|
||||
window.location.href = "/";
|
||||
}
|
||||
|
||||
if (!args.allowFail && !res.ok)
|
||||
|
||||
@@ -23,4 +23,17 @@ export class UserApi {
|
||||
})
|
||||
).data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update user profile
|
||||
*/
|
||||
static async UpdateProfile(name: string): Promise<void> {
|
||||
await APIClient.exec({
|
||||
uri: "/user/update_profile",
|
||||
method: "POST",
|
||||
jsonData: {
|
||||
name: name,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user