Files
lettersoup-online/002_source/cms/src/db/Notifications/mark-one-as-read.tsx
louiscklaw cf70e2af21 ```
refactor notifications popover to include unread count, mark all as read button, and loading state
```
2025-05-12 13:10:19 +08:00

12 lines
423 B
TypeScript

// api method for update notification record
// RULES:
// TBA
import { pb } from '@/lib/pb';
import { COL_NOTIFICATIONS } from '@/constants';
import type { RecordModel } from 'pocketbase';
import type { NotificationFormProps } from '@/components/dashboard/notification/type.d';
export async function MarkOneAsRead(id: string): Promise<RecordModel> {
return pb.collection(COL_NOTIFICATIONS).update(id, { read: true });
}