mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-04-01 18:32:36 +00:00
24 lines
748 B
Rust
24 lines
748 B
Rust
//! # 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)
|
|
} |