Skip to content

Issue #49 — Backend: Mark All Notifications as Read #676

@yusuftomilola

Description

@yusuftomilola

Location: backend/src/notifications/

Description

Members should be able to clear their entire unread notification count in one action — useful when they return after a period of absence and have many unread items. This endpoint marks every unread notification for the requesting user as read in a single bulk update.

Acceptance Criteria

  • PATCH /notifications/read-all marks all of the requesting user's unread notifications as read
    • Performs a bulk update: UPDATE notifications SET isRead = true WHERE userId = :userId AND isRead = false
    • Returns { success: true, message: "All notifications marked as read" }
  • Important: The read-all route must be defined before the :id route in the controller to prevent NestJS from treating read-all as a UUID parameter
  • Uses @GetCurrentUser('id') to scope the update to the requesting user only
  • npx tsc --noEmit passes with no errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions