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 ```
17 lines
601 B
TypeScript
17 lines
601 B
TypeScript
// PURPOSE:
|
|
// Create new notification record
|
|
//
|
|
// RULES:
|
|
// 1. Uses COL_NOTIFICATIONS collection
|
|
// 2. Requires NotificationFormProps type data
|
|
// 3. Returns Promise<RecordModel> with created record
|
|
// 4. Errors handled by caller
|
|
import { pb } from '@/lib/pb';
|
|
import { COL_NOTIFICATIONS } from '@/constants';
|
|
import type { NotificationFormProps } from '@/components/dashboard/notification/type.d';
|
|
import type { RecordModel } from 'pocketbase';
|
|
|
|
export async function createNotification(data: NotificationFormProps): Promise<RecordModel> {
|
|
return pb.collection(COL_NOTIFICATIONS).create(data);
|
|
}
|