Can update profile information

This commit is contained in:
2023-06-14 14:14:46 +02:00
parent b64bc8fb6d
commit e3bec527f0
6 changed files with 197 additions and 6 deletions

View File

@@ -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)

View File

@@ -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,
},
});
}
}