From aac5d02a4f0d2087b4a75c70e1b9b753675ffdc2 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 30 Dec 2019 13:50:59 +0100 Subject: [PATCH] Added placeholders for data export and account deletion --- src/controllers/AccountController.ts | 24 ++++++++++++++++++++++++ src/controllers/Routes.ts | 4 ++++ 2 files changed, 28 insertions(+) diff --git a/src/controllers/AccountController.ts b/src/controllers/AccountController.ts index 62fca01..d10e9fb 100644 --- a/src/controllers/AccountController.ts +++ b/src/controllers/AccountController.ts @@ -206,6 +206,30 @@ export class AccountController { h.success("Password changed!"); } + /** + * Export the data of the user + * + * @param h Request handler + */ + public static async ExportData(h: RequestHandler) { + await h.needUserPostPassword("password"); + + // TODO : implement + h.error(500, "Method not implemented yet."); + } + + /** + * Delete a user account + * + * @param h Request handler + */ + public static async DeleteAccount(h: RequestHandler) { + await h.needUserPostPassword("password"); + + // TODO : implement + h.error(500, "Method not implemented yet."); + } + /** * Get the user ID associated to a password reset token * diff --git a/src/controllers/Routes.ts b/src/controllers/Routes.ts index 93c7db3..6c54671 100644 --- a/src/controllers/Routes.ts +++ b/src/controllers/Routes.ts @@ -57,6 +57,10 @@ export const Routes : Route[] = [ {path: "/account/reset_user_passwd", cb: (h) => AccountController.ResetUserPassword(h), needLogin: false}, + {path: "/account/export_data", cb: (h) => AccountController.ExportData(h)}, + + {path: "/account/delete", cb: (h) => AccountController.DeleteAccount(h)}, + // User controller {path: "/user/getInfo", cb: (h) => UserController.GetSingle(h), needLogin: false},