Files
lettersoup-online/002_source/cms/src/db/Notifications/mark-one-as-read.tsx
louiscklaw 59cdf7257b ```
update Implement standardized documentation for all database modules, including purpose, rules, and requirements for each CRUD operation; refactor existing comments to follow new documentation standard
```
2025-05-17 10:02:05 +00:00

18 lines
538 B
TypeScript

// PURPOSE:
// Mark single notification as read
//
// RULES:
// 1. Uses COL_NOTIFICATIONS collection
// 2. Requires valid notification ID string
// 3. Updates read status to true
// 4. Returns Promise<RecordModel> with updated record
// 5. Errors handled by caller
import { COL_NOTIFICATIONS } from '@/constants';
import type { RecordModel } from 'pocketbase';
import { pb } from '@/lib/pb';
export async function MarkOneAsRead(id: string): Promise<RecordModel> {
return pb.collection(COL_NOTIFICATIONS).update(id, { read: true });
}