1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-20 16:35:17 +00:00

Can delete all the posts associated to a movie

This commit is contained in:
2020-07-12 14:20:24 +02:00
parent ead879bc21
commit 2cc8e7da04
3 changed files with 32 additions and 4 deletions

View File

@ -4,7 +4,6 @@
use crate::api_data::movie_api::MovieAPI;
use crate::controllers::routes::RequestResult;
use crate::data::error::ExecError;
use crate::data::http_request_handler::HttpRequestHandler;
use crate::helpers::movies_helper;
@ -17,6 +16,9 @@ pub fn get_list(r: &mut HttpRequestHandler) -> RequestResult {
/// Remove a movie
pub fn delete(r: &mut HttpRequestHandler) -> RequestResult {
// TODO : implement method
r.internal_error(ExecError::boxed_new("Unimplemented method!"))
let movie_id = r.post_movie_id("movieID")?;
movies_helper::delete(&movies_helper::get_info(movie_id)?)?;
r.success("Movie deleted.")
}