From fb99586afcbb3aff974e009f217427e1d454e708 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 25 Jun 2020 17:52:52 +0200 Subject: [PATCH] Implement get group settings method --- src/controllers/groups_controller.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/controllers/groups_controller.rs b/src/controllers/groups_controller.rs index e866d89..90a7c53 100644 --- a/src/controllers/groups_controller.rs +++ b/src/controllers/groups_controller.rs @@ -76,5 +76,10 @@ pub fn get_advanced_info(r: &mut HttpRequestHandler) -> RequestResult { /// Get the settings of the group pub fn get_settings(r: &mut HttpRequestHandler) -> RequestResult { - r.success("implement me") + let group_id = r.post_group_id_with_access("id", GroupAccessLevel::ADMIN_ACCESS)?; + let group = groups_helper::get_info(&group_id)?; + + // For now, this method is the same as the get advanced info method, + // but this might change in the future... + r.set_response(AdvancedGroupApi::new(&group, r.user_id_opt())?) } \ No newline at end of file