refactor notifications popover to include unread count, mark all as read button, and loading state
```
This commit is contained in:
louiscklaw
2025-05-12 13:10:19 +08:00
parent 1a77c3a5e8
commit cf70e2af21
8 changed files with 224 additions and 23 deletions

View File

@@ -0,0 +1,11 @@
// 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 });
}