mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-01-08 11:42:35 +00:00
15 lines
484 B
Rust
15 lines
484 B
Rust
|
//! # Settings controller
|
||
|
//!
|
||
|
//! @author Pierre Hubert
|
||
|
|
||
|
use crate::api_data::general_settings_api::GeneralSettingsAPI;
|
||
|
use crate::controllers::routes::RequestResult;
|
||
|
use crate::data::http_request_handler::HttpRequestHandler;
|
||
|
use crate::helpers::user_helper;
|
||
|
|
||
|
/// Get the general settings of the user
|
||
|
pub fn get_general(r: &mut HttpRequestHandler) -> RequestResult {
|
||
|
let user = user_helper::find_user_by_id(r.user_id_ref()?)?;
|
||
|
|
||
|
r.set_response(GeneralSettingsAPI::new(&user))
|
||
|
}
|