```
refactor student and teacher APIs to use COL_USER_METAS collection, standardize role assignment, and update type definitions ```
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
// api method for crate student record
|
||||
// RULES:
|
||||
// TBA
|
||||
import { COL_STUDENTS, COL_USER_METAS } from '@/constants';
|
||||
import { COL_USER_METAS } from '@/constants';
|
||||
import type { RecordModel } from 'pocketbase';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
import type { CreateFormProps } from '@/components/dashboard/student/type.d';
|
||||
|
||||
export async function createStudent(data: CreateFormProps): Promise<RecordModel> {
|
||||
return pb.collection(COL_USER_METAS).create(data);
|
||||
return pb.collection(COL_USER_METAS).create({ ...data, role: 'student' });
|
||||
}
|
||||
|
4
002_source/cms/src/db/Students/type.d.ts
vendored
4
002_source/cms/src/db/Students/type.d.ts
vendored
@@ -1,4 +1,6 @@
|
||||
import type { BillingAddress } from '@/components/dashboard/user_meta/type.d';
|
||||
//
|
||||
// RULES
|
||||
// type for student record
|
||||
|
||||
// Student type definitions
|
||||
export interface Student {
|
||||
|
Reference in New Issue
Block a user