From bfd7cc0630a86f4a9bc5dfee9cce89a7dcd33090 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 12 Jun 2020 08:50:09 +0200 Subject: [PATCH] Ready to implement new route --- src/controllers/conversations_controller.rs | 6 +++++- src/controllers/routes.rs | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/controllers/conversations_controller.rs b/src/controllers/conversations_controller.rs index a495155..56b707b 100644 --- a/src/controllers/conversations_controller.rs +++ b/src/controllers/conversations_controller.rs @@ -48,8 +48,12 @@ pub fn create(r: &mut HttpRequestHandler) -> RequestResult { /// Get the list of conversations of a user pub fn get_list(r: &mut HttpRequestHandler) -> RequestResult { - let list = conversations_helper::get_list_user(r.user_id()?)?; r.set_response(list.iter().map(|c| ConversationAPI::new(c)).collect::>()) +} + +/// Get information about a single conversation +pub fn get_single(r: &mut HttpRequestHandler) -> RequestResult { + r.success("Implement id") } \ No newline at end of file diff --git a/src/controllers/routes.rs b/src/controllers/routes.rs index 4bebf16..e37836e 100644 --- a/src/controllers/routes.rs +++ b/src/controllers/routes.rs @@ -93,6 +93,9 @@ pub fn get_routes() -> Vec { Route::post("/conversations/getList", Box::new(conversations_controller::get_list)), + Route::post("/conversations/getInfoOne", Box::new(conversations_controller::get_single)), + Route::post("/conversations/getInfosOne", Box::new(conversations_controller::get_single)), + // Virtual directory controller Route::post("/user/findbyfolder", Box::new(virtual_directory_controller::find_user)),