Skip to content

Commit 376a2e4

Browse files
committed
IBX-9060: Fixed loadNotifications
1 parent 814c348 commit 376a2e4

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/bundle/Controller/NotificationController.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ public function getNotificationsAction(Request $request, int $offset, int $limit
6464
$response = new JsonResponse();
6565

6666
try {
67-
$notificationList = $this->notificationService->loadNotifications($offset, $limit);
67+
$notificationList = $this->notificationService->loadNotifications(
68+
new NotificationQuery([], $offset, $limit)
69+
);
6870
$response->setData([
6971
'pending' => $this->notificationService->getPendingNotificationCount(),
7072
'total' => $notificationList->totalCount,
@@ -86,12 +88,7 @@ public function renderNotificationsPageAction(Request $request, int $page): Resp
8688
new NotificationQuery([], 0, PHP_INT_MAX)
8789
)->items;
8890

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'));
9592
sort($notificationTypes);
9693

9794
$searchForm = $this->createForm(SearchType::class, null, [
@@ -275,7 +272,9 @@ public function markAllNotificationsAsReadAction(Request $request): JsonResponse
275272
$response = new JsonResponse();
276273

277274
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;
279278

280279
foreach ($notifications as $notification) {
281280
$this->notificationService->markNotificationAsRead($notification);

0 commit comments

Comments
 (0)