@@ -64,7 +64,9 @@ public function getNotificationsAction(Request $request, int $offset, int $limit
64
64
$ response = new JsonResponse ();
65
65
66
66
try {
67
- $ notificationList = $ this ->notificationService ->loadNotifications ($ offset , $ limit );
67
+ $ notificationList = $ this ->notificationService ->loadNotifications (
68
+ new NotificationQuery ([], $ offset , $ limit )
69
+ );
68
70
$ response ->setData ([
69
71
'pending ' => $ this ->notificationService ->getPendingNotificationCount (),
70
72
'total ' => $ notificationList ->totalCount ,
@@ -86,12 +88,7 @@ public function renderNotificationsPageAction(Request $request, int $page): Resp
86
88
new NotificationQuery ([], 0 , PHP_INT_MAX )
87
89
)->items ;
88
90
89
- $ notificationTypes = array_unique (
90
- array_map (
91
- static fn ($ notification ) => $ notification ->type ,
92
- $ allNotifications
93
- )
94
- );
91
+ $ notificationTypes = array_unique (array_column ($ allNotifications , 'type ' ));
95
92
sort ($ notificationTypes );
96
93
97
94
$ searchForm = $ this ->createForm (SearchType::class, null , [
@@ -275,7 +272,9 @@ public function markAllNotificationsAsReadAction(Request $request): JsonResponse
275
272
$ response = new JsonResponse ();
276
273
277
274
try {
278
- $ notifications = $ this ->notificationService ->loadNotifications (0 , PHP_INT_MAX )->items ;
275
+ $ notifications = $ this ->notificationService ->loadNotifications (
276
+ new NotificationQuery ([], 0 , PHP_INT_MAX )
277
+ )->items ;
279
278
280
279
foreach ($ notifications as $ notification ) {
281
280
$ this ->notificationService ->markNotificationAsRead ($ notification );
0 commit comments