diff --git a/002_source/cms/src/db/Users.old/GetAllCount.tsx b/002_source/cms/src/db/Users.old/GetAllCount.tsx deleted file mode 100644 index b82dc88..0000000 --- a/002_source/cms/src/db/Users.old/GetAllCount.tsx +++ /dev/null @@ -1,15 +0,0 @@ -// REQ0006 -import { COL_USERS } from '@/constants'; - -import { pb } from '@/lib/pb'; - -export default async function GetAllCount(): Promise { - try { - const result = await pb.collection(`users`).getList(1, 9999, { filter: 'email != ""' }); - const { totalItems: count } = result; - return count; - } catch (error) { - console.error(error); - return -99; - } -} diff --git a/002_source/cms/src/db/Users.old/_GUIDELINES.md b/002_source/cms/src/db/Users.old/_GUIDELINES.md deleted file mode 100644 index 17cc639..0000000 --- a/002_source/cms/src/db/Users.old/_GUIDELINES.md +++ /dev/null @@ -1,30 +0,0 @@ -# GUIDELINES - -This folder contains drivers for `User`/`Users` 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/Users/type.d.tsx` - -simple template: - -```typescript -import { pb } from '@/lib/pb'; -import { COL_USERS } from '@/constants'; - -export async function createUser(data: CreateFormProps) { - // ...content - // use direct return of pb.collection (e.g. return pb.collection(xxx)) -} -```