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 ```
18 lines
538 B
TypeScript
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 });
|
|
}
|