From 744111f4164a2f43d8b5ca463efbcd3f4d246a1f Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 22 Jun 2020 14:41:14 +0200 Subject: [PATCH] Ready to implement new route --- src/controllers/conversations_controller.rs | 7 ++++++- src/controllers/routes.rs | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/controllers/conversations_controller.rs b/src/controllers/conversations_controller.rs index 88dfc19..cebfd14 100644 --- a/src/controllers/conversations_controller.rs +++ b/src/controllers/conversations_controller.rs @@ -7,6 +7,7 @@ use std::collections::HashMap; use crate::api_data::conversation_api::ConversationAPI; use crate::api_data::conversation_message_api::ConversationMessageAPI; use crate::api_data::conversations_refresh_api::ConversationRefreshResultAPI; +use crate::api_data::res_count_unread_conversations::ResultCountUnreadConversations; use crate::api_data::res_create_conversation::ResCreateConversation; use crate::api_data::res_find_private_conversations::ResFindPrivateConversations; use crate::controllers::routes::RequestResult; @@ -15,7 +16,6 @@ use crate::data::new_conversation::NewConversation; use crate::data::new_conversation_message::NewConversationMessage; use crate::helpers::{conversations_helper, user_helper}; use crate::utils::string_utils::remove_html_nodes; -use crate::api_data::res_count_unread_conversations::ResultCountUnreadConversations; /// Create a new conversation pub fn create(r: &mut HttpRequestHandler) -> RequestResult { @@ -281,4 +281,9 @@ pub fn count_unread(r: &mut HttpRequestHandler) -> RequestResult { let num = conversations_helper::count_unread_for_user(r.user_id()?)?; r.set_response(ResultCountUnreadConversations::new(num)) +} + +/// Get the list of unread conversations of a user +pub fn list_unread(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 271aa7e..9a04368 100644 --- a/src/controllers/routes.rs +++ b/src/controllers/routes.rs @@ -110,6 +110,8 @@ pub fn get_routes() -> Vec { Route::post("/conversations/get_number_unread", Box::new(conversations_controller::count_unread)), + Route::post("/conversations/get_list_unread", Box::new(conversations_controller::list_unread)), + // Virtual directory controller Route::post("/user/findbyfolder", Box::new(virtual_directory_controller::find_user)),