1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-23 05:49:22 +00:00

Can delete a comment

This commit is contained in:
Pierre HUBERT 2020-07-10 09:02:16 +02:00
parent 5a5bf8c5c3
commit d23411dca7
2 changed files with 12 additions and 1 deletions

View File

@ -67,3 +67,12 @@ pub fn edit(r: &mut HttpRequestHandler) -> RequestResult {
r.success("Content updated.") r.success("Content updated.")
} }
/// Delete a comment
pub fn delete(r: &mut HttpRequestHandler) -> RequestResult {
let comment = r.post_comment_with_full_access("commentID")?;
comments_helper::delete(&comment)?;
r.success("Comment deleted.")
}

View File

@ -225,6 +225,8 @@ pub fn get_routes() -> Vec<Route> {
Route::post("/comments/edit", Box::new(comments_controller::edit)), Route::post("/comments/edit", Box::new(comments_controller::edit)),
Route::post("/comments/delete", Box::new(comments_controller::delete)),
// Movies controller // Movies controller