diff --git a/src/controllers/conversations_controller.rs b/src/controllers/conversations_controller.rs index e42d1f5..cdf3041 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::list_unread_conversations_api::UnreadConversationAPI; 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; @@ -16,7 +17,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::list_unread_conversations_api::UnreadConversationAPI; /// Create a new conversation pub fn create(r: &mut HttpRequestHandler) -> RequestResult { @@ -289,4 +289,9 @@ pub fn list_unread(r: &mut HttpRequestHandler) -> RequestResult { let list = conversations_helper::get_list_unread(r.user_id()?)?; r.set_response(UnreadConversationAPI::for_list(&list)) +} + +/// Delete a conversation +pub fn delete_conversation(r: &mut HttpRequestHandler) -> RequestResult { + r.success("Delete a conversation") } \ No newline at end of file diff --git a/src/controllers/routes.rs b/src/controllers/routes.rs index 9a04368..d69f8bf 100644 --- a/src/controllers/routes.rs +++ b/src/controllers/routes.rs @@ -1,7 +1,7 @@ use std::error::Error; +use crate::controllers::{account_controller, conversations_controller, server_controller, user_controller, virtual_directory_controller}; use crate::controllers::routes::Method::{GET, POST}; -use crate::controllers::{server_controller, account_controller, user_controller, virtual_directory_controller, conversations_controller}; use crate::data::http_request_handler::HttpRequestHandler; /// Project routes @@ -112,6 +112,8 @@ pub fn get_routes() -> Vec { Route::post("/conversations/get_list_unread", Box::new(conversations_controller::list_unread)), + Route::post("/conversations/delete", Box::new(conversations_controller::delete_conversation)), + // Virtual directory controller Route::post("/user/findbyfolder", Box::new(virtual_directory_controller::find_user)),