mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-01-30 22:13:01 +00:00
Can block the creation of new choices
This commit is contained in:
parent
715cfb0716
commit
6b0363935e
@ -241,6 +241,8 @@ pub fn get_routes() -> Vec<Route> {
|
||||
|
||||
Route::post("/surveys/create_new_choice", Box::new(surveys_controller::create_new_choice)),
|
||||
|
||||
Route::post("/surveys/block_new_choices_creation", Box::new(surveys_controller::block_new_choices_creation)),
|
||||
|
||||
|
||||
|
||||
// Movies controller
|
||||
|
@ -79,3 +79,12 @@ pub fn create_new_choice(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
|
||||
r.success("Choice created")
|
||||
}
|
||||
|
||||
/// Block the creation of new choices
|
||||
pub fn block_new_choices_creation(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
let survey_id = r.post_survey_id_from_post_id("postID", PostAccessLevel::FULL_ACCESS)?;
|
||||
|
||||
survey_helper::block_new_choices_creation(survey_id)?;
|
||||
|
||||
r.success("")
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user