Files
lettersoup-online/002_source/cms/src/db/Customers/_GUIDELINES.md
louiscklaw 7105bc85e3 update,
2025-05-08 14:38:34 +08:00

1.0 KiB

GUIDELINES

This folder contains drivers for Customer/Customers(Collection ID: pbc_108570809) records using PocketBase:

  • create (Create.tsx)
  • read (GetById.tsx)
  • write (Update.tsx)
  • count (GetAllCount.tsx, GetActiveCount.tsx, GetBlockedCount.tsx, GetPendingCount.tsx)
  • misc (Helloworld.tsx)
  • delete (Delete.tsx)
  • list (GetAll.tsx)

the @ sign refer to /home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src

Assumption and Requirements

  • assume pb is located in @/lib/pb
  • no need to handle error in this function, i'll handle it in the caller
  • type information defined in /home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/Customers/type.d.tsx

simple template:

import { pb } from '@/lib/pb';
import { COL_CUSTOMERS } from '@/constants';

export async function createCustomer(data: CreateFormProps) {
  // ...content
  // use direct return of pb.collection (e.g. return pb.collection(xxx))
}