From bef9dfffbcdff3265e54a9f44fed5da5fde53091 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 29 Jun 2020 09:10:57 +0200 Subject: [PATCH] Add route --- src/controllers/groups_controller.rs | 7 +++++++ src/controllers/routes.rs | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/controllers/groups_controller.rs b/src/controllers/groups_controller.rs index 469ecc1..0ca8f58 100644 --- a/src/controllers/groups_controller.rs +++ b/src/controllers/groups_controller.rs @@ -11,6 +11,7 @@ use crate::api_data::res_change_group_logo::ResChangeGroupLogo; use crate::api_data::res_create_group::GroupCreationResult; use crate::constants::{DEFAULT_GROUP_LOGO, PATH_GROUPS_LOGOS}; use crate::controllers::routes::RequestResult; +use crate::data::error::ExecError; use crate::data::group::{Group, GroupAccessLevel, GroupPostsCreationLevel, GroupRegistrationLevel, GroupVisibilityLevel}; use crate::data::group_id::GroupID; use crate::data::group_member::{GroupMember, GroupMembershipLevel}; @@ -362,4 +363,10 @@ pub fn set_following(r: &mut HttpRequestHandler) -> RequestResult { groups_helper::set_following(&group_id, &r.user_id()?, following)?; r.success("Following status updated.") +} + +/// Delete a group +pub fn delete_group(r: &mut HttpRequestHandler) -> RequestResult { + // TODO : implement groups deletion + r.internal_error(ExecError::boxed_new("Method not implemented yet")) } \ No newline at end of file diff --git a/src/controllers/routes.rs b/src/controllers/routes.rs index 9e2341a..383024c 100644 --- a/src/controllers/routes.rs +++ b/src/controllers/routes.rs @@ -172,6 +172,8 @@ pub fn get_routes() -> Vec { Route::post("/groups/set_following", Box::new(groups_controller::set_following)), + Route::post("/groups/delete", Box::new(groups_controller::delete_group)), + // Virtual directory controller Route::post("/user/findbyfolder", Box::new(virtual_directory_controller::find_user)),