mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-01-14 14:37:44 +00:00
Add placeholder for account deletion
This commit is contained in:
parent
bb86830db4
commit
fb7f56c359
@ -9,7 +9,7 @@ use crate::api_data::res_check_security_questions_exists::ResCheckSecurityQuesti
|
||||
use crate::api_data::res_get_security_questions::ResGetSecurityQuestions;
|
||||
use crate::constants::PASSWORD_RESET_TOKEN_LENGTH;
|
||||
use crate::controllers::routes::RequestResult;
|
||||
use crate::data::error::ResultBoxError;
|
||||
use crate::data::error::{ExecError, ResultBoxError};
|
||||
use crate::data::http_request_handler::HttpRequestHandler;
|
||||
use crate::data::new_account::NewAccount;
|
||||
use crate::data::user::{User, UserID};
|
||||
@ -188,4 +188,12 @@ pub fn export_data(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
let data = account_helper::export(r.user_id_ref()?)?;
|
||||
|
||||
r.set_response(AccountExportAPI::new(&data)?)
|
||||
}
|
||||
|
||||
/// Delete an account
|
||||
pub fn delete_account(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
r.need_user_password("password")?;
|
||||
|
||||
// TODO : implement me
|
||||
r.internal_error(ExecError::boxed_new("Not implemented yet"))
|
||||
}
|
@ -82,6 +82,7 @@ pub fn get_routes() -> Vec<Route> {
|
||||
Route::post_without_login("/account/check_password_reset_token", Box::new(account_controller::check_password_reset_token)),
|
||||
Route::post_without_login("/account/reset_user_passwd", Box::new(account_controller::reset_user_password)),
|
||||
Route::post("/account/export_data", Box::new(account_controller::export_data)),
|
||||
Route::post("/account/delete", Box::new(account_controller::delete_account)),
|
||||
|
||||
// User controller
|
||||
Route::post_without_login("/user/getInfo", Box::new(user_controller::get_single)),
|
||||
|
Loading…
Reference in New Issue
Block a user