This commit is contained in:
louiscklaw
2025-04-24 01:08:44 +08:00
parent 41cc82d54d
commit da08798b10
87 changed files with 66682 additions and 6003 deletions

View File

@@ -0,0 +1,30 @@
# GUIDELINES
This folder contains drivers for `LessonCategory`/`LessonCategories` records using PocketBase:
- create (Create.tsx)
- read (GetById.tsx)
- write (Update.tsx)
- count (GetAllCount.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 `@/db/LessonCategories/type.d.tsx`
simple template:
```typescript
import { pb } from '@/lib/pb';
import { COL_LESSON_CATEGORIES } from '@/constants';
export async function createLessonCategory(data: CreateFormProps) {
// ...content
// use direct return of pb.collection (e.g. return pb.collection(xxx))
}
```