@@ -68,7 +71,7 @@ const ProfileController: ComponentType
= ({ userId, onSubmit, refreshUser
export default connect(
(state) => ({
- userId: state.user.id!,
+ user: state.user,
}),
{
refreshUserData,
diff --git a/packages/app/services/api/accounts.ts b/packages/app/services/api/accounts.ts
index d07618a..6483443 100644
--- a/packages/app/services/api/accounts.ts
+++ b/packages/app/services/api/accounts.ts
@@ -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`);
+}