Skip to content

fix(notifications): call the correct read-all API route - #1804

Open
bfs2021 wants to merge 1 commit into
DistinctCodes:mainfrom
bfs2021:fix/notifications-read-all-path
Open

bfs2021 wants to merge 1 commit into
DistinctCodes:mainfrom
bfs2021:fix/notifications-read-all-path

Conversation

@bfs2021

@bfs2021 bfs2021 commented Nov 18, 2026

Copy link
Copy Markdown

Problem

Fixes #1757

The frontend "Mark all as read" button calls PATCH /notifications/mark-all-read, but NotificationsController only exposes @Patch('read-all'). The request therefore always returns 404 and the button never works.

Root cause

notificationsApiClient.markAllRead in frontend/lib/api/notifications.ts uses the wrong URL segment (mark-all-read) instead of the route actually registered by the backend (read-all).

Fix

Changed the markAllRead client method to PATCH /notifications/read-all, matching the backend route. Added a regression test that mocks the API client and asserts the exact path the method calls.

Testing

  • Added __tests__/notifications-api.test.ts with a test asserting api.patch is called with /notifications/read-all.
  • Confirmed the test fails on unfixed code (Expected "/notifications/read-all", Received "/notifications/mark-all-read"), then passes after the fix.
  • npx jest --ci __tests__/notifications-api.test.ts — 1 passed.
  • npx eslint __tests__/notifications-api.test.ts lib/api/notifications.ts — clean.
  • Full frontend suite: 16 pre-existing failing suites on clean HEAD (date-dependent assertions and Playwright e2e specs collected by jest); this change adds no new failures and one new passing suite (19→20 passing).

Signed-off-by: bfs2021 <101915083+bfs2021@users.noreply.github.com>
@vercel

vercel Bot commented Nov 18, 2026

Copy link
Copy Markdown

@bfs2021 is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'Mark all as read' calls /notifications/mark-all-read, but the backend route is /notifications/read-all

1 participant