Skip to content

Conversation

@camila-carrillo
Copy link
Contributor

ℹ️ Issue

Closes #199

📝 Description

Write a short summary of what you added. Why is it important? Any member of C4C should be able to read this and understand your contribution -- not just your team members.

Connected the notification popup to the backend API, enabling users to view and delete their notifications in real-time. Removed dummy data. Integrated frontend with backend notification endpoints in order to fetch user-specific notifications and delete them from the database.

Briefly list the changes made to the code:

  1. Updated BellButton.tsx to fetch notifications from backend GET /notifications/user/:userId endpoint when bell icon is clicked
  2. Added handleDelete function in NotificationPopup.tsx that calls backend DELETE /notifications/:notificationId endpoint and refetches updated notification list to keep UI in sync with database
  3. Wrapped NotificationPopup component with observer to enable reactive UI updates when store changes
  4. Made the trash icon in GrantNotification.tsx functional by adding an onClick handler that triggers deletion through a callback to the parent component, passing the notificationId to identify which notification to delete
  5. Updated store.ts notifications field type to proper Notification type imported from middle-layer
  6. Added NotificationModule import to backend grant.module.ts to resolve NestJS dependency injection

✔️ Verification

What steps did you take to verify your changes work? These should be clear enough for someone to be able to clone the branch and follow the steps themselves.

Tested features as if I were a user, checked DynamoDB that deleted notifications are removed from the database.

Screenshot (16) Screenshot (18) Screenshot (19)

Test Changes

If your new feature required some test to be changed or added to fit the new functionality or changes please document these changes here.

🏕️ (Optional) Future Work / Notes

  1. The backend /auth/session endpoint returns 404, preventing the frontend from verifying logged-in users. As a temporary workaround, userId is hardcoded for testing and should be replaced once the session endpoint is implemented.
  2. When no notifications exist for a user, the backend throws a 500 error instead of returning an empty array. This prevents the UI from updating after deleting the last notification, requiring a page refresh to see the empty state (though the deletion itself succeeds in the database).

Copy link
Contributor

@aaronashby aaronashby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff, Camila! Just commented on a few small things, but otherwise this looks good 🫡

prooflesben and others added 8 commits November 29, 2025 19:49
…connect-notifications-to-backend, Merged in main feel free to undo these changes if needed or if i got anythign incorrect to do so look up how to rewind one commit
…199-dev---display-notifications-by-user-and-connect-notifications-to-backend
…t have their alert date as before the current date)
Copy link
Collaborator

@prooflesben prooflesben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good

@lyannne lyannne self-requested a review December 4, 2025 00:19
Copy link
Collaborator

@lyannne lyannne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@prooflesben prooflesben merged commit 1f2084f into main Dec 4, 2025
1 check passed
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.

DEV - display notifications by user and connect notifications to backend

5 participants