update build ok,
This commit is contained in:
@@ -1,14 +1,26 @@
|
||||
# AI GUIDELINE
|
||||
|
||||
## Background information and References
|
||||
## getting started
|
||||
|
||||
please read `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/001_documentation/Requirements/REQ0006/schema.dbml`
|
||||
no need to reply me what you are going on and your digest in this phase.
|
||||
just reply me "OK" when done
|
||||
|
||||
please read `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/schema.json`
|
||||
base_dir=`/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project`
|
||||
|
||||
please look into the md files in `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/_AI_GUIDELINE`
|
||||
please read `<base_dir>/001_documentation/Requirements/REQ0006/schema.dbml`
|
||||
this is file in dbml syntax state the main database
|
||||
|
||||
please read, remember and link up the ideas, i will tell you the task afterwards
|
||||
please read `<base_dir>/002_source/cms/src/db/schema.json`
|
||||
this is the file of live pocketbase schema output
|
||||
|
||||
please look into the md files in folder `<base_dir>/002_source/cms/_AI_GUIDELINE`
|
||||
|
||||
please read, remember and link up the ideas in file stated above,
|
||||
i will tell you the task afterwards
|
||||
|
||||
this is now not in debug phase,
|
||||
so, no need to reply me what you are going on or your insight throught the prompt.
|
||||
just reply me "OK" when done
|
||||
|
||||
---
|
||||
|
||||
@@ -45,3 +57,25 @@ when you draft coding, review file and append with `.tsx.draft`
|
||||
## tasks
|
||||
|
||||
Thanks
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
please take a look in `schema.dbml` and `schema.json`,
|
||||
associate the collection from json file to the table in dbml file
|
||||
|
||||
please modify the `schema.dbml` to align with `schema.json`
|
||||
|
||||
to the collection `QuizLPCategories` align the dbml file in the previous prompt
|
||||
|
||||
|
||||
---
|
||||
|
||||
please revise
|
||||
|
||||
please revise
|
||||
`/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/types/LpCategory.tsx` `interface LpCategory`
|
||||
|
||||
to the collection `QuizLPCategories` align the dbml file in the previous prompt
|
||||
|
8
002_source/cms/src/db/QuizListenings/GetById.tsx
Normal file
8
002_source/cms/src/db/QuizListenings/GetById.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
import { COL_QUIZ_LISTENINGS } from '@/constants';
|
||||
import type { RecordModel } from 'pocketbase';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default function getQuizListeningById(id: string): Promise<RecordModel> {
|
||||
return pb.collection(COL_QUIZ_LISTENINGS).getOne(id);
|
||||
}
|
14
002_source/cms/src/db/QuizListenings/GetHiddenCount.tsx
Normal file
14
002_source/cms/src/db/QuizListenings/GetHiddenCount.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
// REQ0006
|
||||
import { COL_QUIZ_LISTENINGS } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function GetHiddenCount(): Promise<number> {
|
||||
try {
|
||||
const result = await pb.collection(COL_QUIZ_LISTENINGS).getList(1, 9999, { filter: 'visible = "hidden"' });
|
||||
const { totalItems: count } = result;
|
||||
return count;
|
||||
} catch (error) {
|
||||
return 0;
|
||||
}
|
||||
}
|
14
002_source/cms/src/db/QuizListenings/GetVisibleCount.tsx
Normal file
14
002_source/cms/src/db/QuizListenings/GetVisibleCount.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
// REQ0006
|
||||
import { COL_QUIZ_LISTENINGS } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function GetVisibleCount(): Promise<number> {
|
||||
try {
|
||||
const result = await pb.collection(COL_QUIZ_LISTENINGS).getList(1, 9999, { filter: 'visible = "visible"' });
|
||||
const { totalItems: count } = result;
|
||||
return count;
|
||||
} catch (error) {
|
||||
return 0;
|
||||
}
|
||||
}
|
22
002_source/cms/src/db/QuizListenings/ListWithOption.tsx
Normal file
22
002_source/cms/src/db/QuizListenings/ListWithOption.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { COL_QUIZ_LISTENINGS } from '@/constants';
|
||||
import type { ListResult, RecordModel } from 'pocketbase';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
interface ListWithOptionParams {
|
||||
currentPage: number;
|
||||
rowsPerPage: number;
|
||||
listOption?: {
|
||||
filter?: string;
|
||||
sort?: string;
|
||||
expand?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export default function listWithOption({
|
||||
currentPage,
|
||||
rowsPerPage,
|
||||
listOption = {},
|
||||
}: ListWithOptionParams): Promise<ListResult<RecordModel>> {
|
||||
return pb.collection(COL_QUIZ_LISTENINGS).getList(currentPage + 1, rowsPerPage, listOption);
|
||||
}
|
Reference in New Issue
Block a user