From bc8fdb13f1ca577fd6beed26b71d160301369d2e Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 9 Jul 2020 09:32:45 +0200 Subject: [PATCH] Ready to implement new route --- src/controllers/posts_controller.rs | 5 +++++ src/controllers/routes.rs | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/controllers/posts_controller.rs b/src/controllers/posts_controller.rs index d35445e..cdf4c63 100644 --- a/src/controllers/posts_controller.rs +++ b/src/controllers/posts_controller.rs @@ -259,4 +259,9 @@ pub fn update_content(r: &mut HttpRequestHandler) -> RequestResult { // TODO : Delete the notifications targeting the current user about this post r.success("Content updated") +} + +/// Delete a post +pub fn delete(r: &mut HttpRequestHandler) -> RequestResult { + r.success("Implement me") } \ No newline at end of file diff --git a/src/controllers/routes.rs b/src/controllers/routes.rs index 92d5e43..fabc78b 100644 --- a/src/controllers/routes.rs +++ b/src/controllers/routes.rs @@ -1,6 +1,6 @@ use std::error::Error; -use crate::controllers::{account_controller, conversations_controller, friends_controller, groups_controller, search_controller, server_controller, user_controller, virtual_directory_controller, posts_controller, movies_controller}; +use crate::controllers::{account_controller, conversations_controller, friends_controller, groups_controller, movies_controller, posts_controller, search_controller, server_controller, user_controller, virtual_directory_controller}; use crate::controllers::routes::Method::{GET, POST}; use crate::data::http_request_handler::HttpRequestHandler; @@ -212,6 +212,8 @@ pub fn get_routes() -> Vec { Route::post("/posts/update_content", Box::new(posts_controller::update_content)), + Route::post("/posts/delete", Box::new(posts_controller::delete)), + // Movies controller Route::post("/movies/get_list", Box::new(movies_controller::get_list)),