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
676 B
TypeScript
18 lines
676 B
TypeScript
// PURPOSE:
|
|
// Update notification record
|
|
//
|
|
// RULES:
|
|
// 1. Uses COL_NOTIFICATIONS collection
|
|
// 2. Requires valid notification ID string
|
|
// 3. Accepts Partial<NotificationFormProps> update data
|
|
// 4. Returns Promise<RecordModel> with updated record
|
|
// 5. Errors handled by caller
|
|
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 updateNotification(id: string, data: Partial<NotificationFormProps>): Promise<RecordModel> {
|
|
return pb.collection(COL_NOTIFICATIONS).update(id, data);
|
|
}
|