Skip to content

Issue #48 — Backend: Mark Single Notification as Read #677

@yusuftomilola

Description

@yusuftomilola

Location: backend/src/notifications/

Description

When a member opens or clicks a notification, it should be marked as read so the unread badge count decreases. This endpoint marks a single notification as read by its ID. The endpoint must verify that the notification belongs to the requesting user before updating it.

Acceptance Criteria

  • PATCH /notifications/:id/read marks a single notification as read
    • Finds the notification by id — throws NotFoundException if it does not exist
    • Throws ForbiddenException if the notification does not belong to the requesting user
    • Sets isRead to true and saves the record
    • Returns { success: true, message: "Notification marked as read", data: Notification }
  • Uses @GetCurrentUser('id') to identify the requesting user
  • 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