mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-12-25 13:08:50 +00:00
Start to create report route
This commit is contained in:
parent
0eebfbe98a
commit
98e267f7e7
@ -20,4 +20,5 @@ pub mod web_app_controller;
|
||||
pub mod calls_controller;
|
||||
pub mod user_ws_actions;
|
||||
pub mod push_notifications_controller;
|
||||
pub mod forez_controller;
|
||||
pub mod report_controller;
|
||||
pub mod forez_controller;
|
||||
|
15
src/controllers/report_controller.rs
Normal file
15
src/controllers/report_controller.rs
Normal file
@ -0,0 +1,15 @@
|
||||
use crate::data::base_request_handler::BaseRequestHandler;
|
||||
use crate::data::config::conf;
|
||||
use crate::data::http_request_handler::HttpRequestHandler;
|
||||
use crate::routes::RequestResult;
|
||||
|
||||
/// Submit a new report
|
||||
pub async fn report(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
if !conf().allow_reporting {
|
||||
r.bad_request("Reporting is disabled!".to_string())?;
|
||||
}
|
||||
|
||||
// TODO : continue
|
||||
|
||||
r.success("go on")
|
||||
}
|
@ -440,6 +440,9 @@ pub async fn find_route(req_uri: &str, call: Option<&mut HttpRequestHandler>) ->
|
||||
// Web application controller
|
||||
route!(req_uri, call, POST_LOGIN, "/webApp/getMemberships", web_app_controller::get_memberships);
|
||||
|
||||
// Report controller
|
||||
route!(req_uri, call, LTD_POST_LOGIN, "/report/create", report_controller::report, LimitPolicy::ANY(10));
|
||||
|
||||
// Forez controller
|
||||
route!(req_uri, call, POST_LOGIN, "/forez/get_groups", forez_controller::get_list_groups);
|
||||
route!(req_uri, call, POST_LOGIN, "/forez/get_member_info", forez_controller::get_member_info);
|
||||
|
Loading…
Reference in New Issue
Block a user