From 43305ef600ddd0b5d7b49cef0f0cd5e26f5cb9a3 Mon Sep 17 00:00:00 2001 From: openhands Date: Sat, 18 Jul 2026 15:40:37 +0200 Subject: [PATCH] Fix notifications API returning object instead of array getNotifications() returns { notifications, total }, but the API route wrapped that whole object as data.notifications. The client then called .slice() on an object, throwing 's.slice is not a function' and crashing every page via the global NotificationBell. Extract the array before returning. --- src/app/api/notifications/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/api/notifications/route.ts b/src/app/api/notifications/route.ts index b2e7944f..1726443a 100644 --- a/src/app/api/notifications/route.ts +++ b/src/app/api/notifications/route.ts @@ -11,7 +11,7 @@ export async function GET() { } const userId = Number(session.user.id); - const notifications = await notificationService.getNotifications(userId); + const { notifications } = await notificationService.getNotifications(userId); const unreadCount = await notificationService.getUnreadCount(userId); return NextResponse.json({ notifications, unreadCount });