-
Notifications
You must be signed in to change notification settings - Fork 134
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
Location: frontend/lib/react-query/hooks/notifications/
Description
The NotificationBell component and the full notifications page both need React Query hooks to fetch and mutate notification data. This issue implements the three hooks needed: fetching the list, marking a single notification as read, and marking all as read.
The project uses a shared apiClient at frontend/lib/apiClient.ts and centralised query keys in frontend/lib/react-query/keys/queryKeys.ts. Add any new keys there.
Acceptance Criteria
-
useGetNotifications.ts— wrapsGET /notificationswithpageandlimitparams. ReturnsNotificationsResponse. Uses astaleTimeof 30 seconds to avoid excessive refetching -
useMarkNotificationRead.ts— wrapsPATCH /notifications/:id/read. Acceptsid: stringas the mutation variable. On success, invalidates the notifications query so the unread count and list update -
useMarkAllRead.ts— wrapsPATCH /notifications/read-all. On success, invalidates the notifications query - All three files are marked
"use client"and placed underfrontend/lib/react-query/hooks/notifications/ - Query keys for notifications are added to
frontend/lib/react-query/keys/queryKeys.ts -
npx tsc --noEmitpasses with no errors
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers