Files
lettersoup-online/002_source/cms/src/db/Students/Update.tsx
louiscklaw 59cdf7257b ```
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
```
2025-05-17 10:02:05 +00:00

19 lines
662 B
TypeScript

// PURPOSE:
// Update student record in database
//
// RULES:
// 1. Uses COL_USER_METAS collection with role='student'
// 2. Requires valid student ID string
// 3. Accepts Partial<EditFormProps> update data
// 4. Returns Promise<RecordModel> with updated record
// 5. Throws error if update fails
import { pb } from '@/lib/pb';
import { COL_USER_METAS } from '@/constants';
import type { RecordModel } from 'pocketbase';
import type { EditFormProps } from '@/components/dashboard/customer/type.d';
export async function updateCustomer(id: string, data: Partial<EditFormProps>): Promise<RecordModel> {
return pb.collection(COL_USER_METAS).update(id, data);
}