mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-09-25 22:29:45 +00:00
Can get the list of unread notifications
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
//!
|
||||
//! @author Pierre Hubert
|
||||
|
||||
use crate::api_data::notification_api::NotificationAPI;
|
||||
use crate::api_data::res_count_all_unreads::ResCountAllUnread;
|
||||
use crate::api_data::res_number_unread_notifications::ResNumberUnreadNotifications;
|
||||
use crate::controllers::routes::RequestResult;
|
||||
@@ -24,4 +25,11 @@ pub fn count_all_news(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
};
|
||||
|
||||
r.set_response(ResCountAllUnread::new(notifications, conversations as u64, friends_requests))
|
||||
}
|
||||
|
||||
/// Get the list of unread notifications
|
||||
pub fn get_list_unread(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
let list = notifications_helper::get_list_unread(r.user_id_ref()?)?;
|
||||
|
||||
r.set_response(NotificationAPI::for_list(&list))
|
||||
}
|
Reference in New Issue
Block a user