Skip to content

feat(notifications): add mark all as read API#500

Merged
codeZe-us merged 1 commit into
SafeVault:devfrom
Ghadaffijr:feat/472-mark-all-read-api
Jun 1, 2026
Merged

feat(notifications): add mark all as read API#500
codeZe-us merged 1 commit into
SafeVault:devfrom
Ghadaffijr:feat/472-mark-all-read-api

Conversation

@Ghadaffijr
Copy link
Copy Markdown

Closes #472

Pull Request

Summary

Added the PATCH /api/v1/dashboard/notifications/read-all endpoint and the supporting service layer to allow authenticated users to mark all of their unread notifications as read. The implementation utilizes Drizzle ORM and adheres to the existing AuthUtils and ApiResponse patterns.

Note to reviewers: The notifications table schema does not currently exist in the dev branch. I built the service layer assuming standard naming conventions (userId, isRead). I have included a @ts-ignore on the schema import to prevent CI build failures until the schema is merged in a separate PR.

Type of Change

  • Feature
  • Bug Fix
  • Refactoring
  • Documentation
  • Tests
  • Infrastructure / CI

Linked Issues

Fixes #472

Key Changes

  • Created src/server/services/notification.service.ts with markAllUnreadAsRead function using Drizzle ORM.
  • Created src/app/api/v1/dashboard/notifications/read-all/route.ts with a PATCH handler.
  • Integrated AuthUtils.authenticateRequest for secure user identification.
  • Utilized ApiResponse.success and ApiResponse.error for standardized response formatting.

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new linting/type-checking warnings. (Note: Used targeted @ts-ignore for the missing schema)
  • I have added tests that prove my fix is effective or that my feature works.
  • I have updated the documentation accordingly.

Screenshots / Recordings

N/A - Backend API implementation only.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

@Ghadaffijr is attempting to deploy a commit to the vestroll's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Ghadaffijr Ghadaffijr changed the base branch from main to dev May 31, 2026 12:59
@codeZe-us codeZe-us self-requested a review June 1, 2026 16:34
@codeZe-us codeZe-us merged commit afba06b into SafeVault:dev Jun 1, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Mark all as read API for Notifications

2 participants