Repository navigation
Conversation
Signed-off-by: bfs2021 <101915083+bfs2021@users.noreply.github.com>
|
@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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fixes #1757
The frontend "Mark all as read" button calls
PATCH /notifications/mark-all-read, butNotificationsControlleronly exposes@Patch('read-all'). The request therefore always returns 404 and the button never works.Root cause
notificationsApiClient.markAllReadinfrontend/lib/api/notifications.tsuses the wrong URL segment (mark-all-read) instead of the route actually registered by the backend (read-all).Fix
Changed the
markAllReadclient 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
__tests__/notifications-api.test.tswith a test assertingapi.patchis called with/notifications/read-all.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.