Can delete account

This commit is contained in:
2023-06-15 09:33:41 +02:00
parent fc58e65ea1
commit 6a399ac52a
4 changed files with 114 additions and 1 deletions

View File

@ -19,6 +19,10 @@ export enum ReplacePasswordResponse {
TooManyRequests,
}
export interface DeleteAccountTokenInfo {
email: string;
}
export class UserApi {
/**
* Get current user information
@ -89,4 +93,30 @@ export class UserApi {
method: "GET",
});
}
/**
* Check delete account token
*/
static async CheckDeleteAccountToken(
token: string
): Promise<DeleteAccountTokenInfo> {
return (
await APIClient.exec({
uri: "/user/check_delete_token",
method: "POST",
jsonData: { token: token },
})
).data;
}
/**
* Delete account
*/
static async DeleteAccount(token: string): Promise<void> {
await APIClient.exec({
uri: "/user/delete_account",
method: "POST",
jsonData: { token: token },
});
}
}