1
0
mirror of https://github.com/flarum/core.git synced 2025-10-19 10:46:06 +02:00

Return both unread and new notification count from the API

Related to #500.
This commit is contained in:
Franz Liedke
2015-09-29 01:26:28 +02:00
parent 56f9016ff7
commit 040ce52724
4 changed files with 38 additions and 11 deletions

View File

@@ -23,6 +23,7 @@ class CurrentUserSerializer extends UserSerializer
$attributes += [
'readTime' => $user->read_time ? $user->read_time->toRFC3339String() : null,
'unreadNotificationsCount' => $user->getUnreadNotificationsCount(),
'newNotificationsCount' => $user->getNewNotificationsCount(),
'preferences' => $user->preferences
];
}