1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-27 07:49:21 +00:00
comunicapiv3/src/controllers/movies_controller.rs

22 lines
678 B
Rust
Raw Normal View History

//! # Movies controller
//!
//! @author Pierre Hubert
use crate::api_data::movie_api::MovieAPI;
use crate::controllers::routes::RequestResult;
2020-07-08 11:46:54 +00:00
use crate::data::error::ExecError;
use crate::data::http_request_handler::HttpRequestHandler;
use crate::helpers::movies_helper;
/// Get the list of movies of the current user
pub fn get_list(r: &mut HttpRequestHandler) -> RequestResult {
let list = movies_helper::get_list_user(r.user_id_ref()?)?;
r.set_response(MovieAPI::for_list(&list))
2020-07-08 11:46:54 +00:00
}
/// Remove a movie
pub fn delete(r: &mut HttpRequestHandler) -> RequestResult {
// TODO : implement method
r.internal_error(ExecError::boxed_new("Unimplemented method!"))
}