1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-01-08 11:42:35 +00:00
comunicapiv3/src/controllers/settings_controller.rs

15 lines
484 B
Rust
Raw Normal View History

2020-07-14 09:15:20 +00:00
//! # 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))
}