mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-12-24 12:38:58 +00:00
Can get the number of unread notifications and conversations in a single API request
This commit is contained in:
parent
2f37d37a54
commit
3d874b550b
@ -27,6 +27,26 @@ class notificationsController {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Count all the new kinds of data
|
||||
*
|
||||
* - notifications
|
||||
* - unread conversations
|
||||
*
|
||||
* @url POST notifications/count_all_news
|
||||
*/
|
||||
public function count_all_news(){
|
||||
|
||||
user_login_required();
|
||||
|
||||
//Get and return the data
|
||||
return array(
|
||||
"notifications" => components()->notifications->count_unread(userID),
|
||||
"conversations" => components()->conversations->number_user_unread(userID)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the list of unread notifications of a user
|
||||
|
Loading…
Reference in New Issue
Block a user