mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-12-28 14:38:52 +00:00
Ready to delete conversations
This commit is contained in:
parent
93a52d083f
commit
08811926be
@ -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")
|
||||
}
|
@ -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> {
|
||||
|
||||
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)),
|
||||
|
Loading…
Reference in New Issue
Block a user