//! # Notifications controller //! //! @author Pierre Hubert use crate::api_data::res_number_unread_notifications::ResNumberUnreadNotifications; use crate::controllers::routes::RequestResult; use crate::data::http_request_handler::HttpRequestHandler; use crate::helpers::notifications_helper; /// Count the number of unread notifications pub fn count_unread(r: &mut HttpRequestHandler) -> RequestResult { let number = notifications_helper::count_unread(r.user_id_ref()?)?; r.set_response(ResNumberUnreadNotifications::new(number)) }