mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-12-28 14:38:52 +00:00
Ready to implement new route
This commit is contained in:
parent
4815de8925
commit
744111f416
@ -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")
|
||||
}
|
@ -110,6 +110,8 @@ pub fn get_routes() -> Vec<Route> {
|
||||
|
||||
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)),
|
||||
|
Loading…
Reference in New Issue
Block a user