refactor GetById APIs for Students, Teachers, and UserMetas to use consistent type definitions and expand parameters
```
This commit is contained in:
louiscklaw
2025-05-15 11:12:29 +08:00
parent e523f80123
commit d0215cf23f
4 changed files with 44 additions and 12 deletions

View File

@@ -1,7 +1,11 @@
import { COL_BILLING_ADDRESS, COL_STUDENTS, COL_USER_METAS } from '@/constants';
import { RecordModel } from 'pocketbase';
// src/db/billingAddress/GetById.tsx
//
// PURPOSE:
// to get billing address by its id
//
import { COL_BILLING_ADDRESS } from '@/constants';
import { logger } from '@/lib/default-logger';
import { pb } from '@/lib/pb';
import type { DBUserMeta, UserMeta } from '@/components/dashboard/user_meta/type.d';
@@ -10,8 +14,6 @@ export async function getBillingAddressById(id: string): Promise<UserMeta> {
.collection(COL_BILLING_ADDRESS)
.getOne<DBUserMeta>(id, { expand: 'billingAddress, helloworld' });
console.log({ record });
const temp: UserMeta = {
id: record.id,
name: record.name,