feat(coderd): add mark-all-as-read endpoint for inbox notifications (#16976)

[Resolve this issue](https://github.com/coder/internal/issues/506)

Add a mark-all-as-read endpoint which is marking as read all
notifications that are not read for the authenticated user.
Also adds the DB logic.
This commit is contained in:
Vincent Vielle
2025-03-20 13:41:54 +01:00
committed by GitHub
parent d8d4b9b86e
commit 4960a1e85a
15 changed files with 262 additions and 0 deletions

View File

@ -57,3 +57,11 @@ SET
read_at = $1
WHERE
id = $2;
-- name: MarkAllInboxNotificationsAsRead :exec
UPDATE
inbox_notifications
SET
read_at = $1
WHERE
user_id = $2 and read_at IS NULL;