
refactor notifications popover to include unread count, mark all as read button, and loading state ```
12 lines
423 B
TypeScript
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 });
|
|
}
|