mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-21 00:45:18 +00:00
Can get the list of Forez groups
This commit is contained in:
24
src/controllers/forez_controller.rs
Normal file
24
src/controllers/forez_controller.rs
Normal file
@ -0,0 +1,24 @@
|
||||
//! # Forez controller
|
||||
//!
|
||||
//! This controller contains the logic specific to the integration of the #Forez application into
|
||||
//! Comunic.
|
||||
//!
|
||||
//! @author Pierre Hubert
|
||||
|
||||
use crate::data::http_request_handler::HttpRequestHandler;
|
||||
use crate::routes::RequestResult;
|
||||
use crate::data::config::conf;
|
||||
use crate::data::base_request_handler::BaseRequestHandler;
|
||||
use crate::api_data::group_api::GroupApi;
|
||||
use crate::helpers::groups_helper;
|
||||
|
||||
/// Get the list of declared Forez groups in the application
|
||||
pub fn get_list_groups(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
let mut list = vec![];
|
||||
|
||||
for group in &conf().forez_groups {
|
||||
list.push(GroupApi::new(&groups_helper::get_info(group)?, r.user_id_opt())?);
|
||||
}
|
||||
|
||||
r.set_response(list)
|
||||
}
|
@ -17,4 +17,5 @@ pub mod virtual_directory_controller;
|
||||
pub mod web_app_controller;
|
||||
pub mod calls_controller;
|
||||
pub mod user_ws_actions;
|
||||
pub mod push_notifications_controller;
|
||||
pub mod push_notifications_controller;
|
||||
pub mod forez_controller;
|
Reference in New Issue
Block a user