Implemented handlers to delete/restore account. Implemented "account deleted" page

This commit is contained in:
ErickSkrauch
2020-07-27 10:28:37 +03:00
parent 9247ad7178
commit c0b3e328b6
9 changed files with 137 additions and 11 deletions

View File

@@ -86,3 +86,13 @@ export function confirmNewEmail(id: number, key: string): Promise<{ success: boo
key,
});
}
export function deleteAccount(id: number, { password }: { password?: string }): Promise<{ success: boolean }> {
return request.delete(`/api/v1/accounts/${id}`, {
password,
});
}
export function restoreAccount(id: number): Promise<{ success: boolean }> {
return request.post(`/api/v1/accounts/${id}/restore`);
}