update,
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { COL_LISTENINGS_PRACTICE_CATEGORIES } from '@/constants';
|
||||
import type { RecordModel } from 'pocketbase';
|
||||
import { COL_QUIZ_LP_CATEGORIES } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default function deleteQuizListening(id: string): Promise<boolean> {
|
||||
return pb.collection(COL_LISTENINGS_PRACTICE_CATEGORIES).delete(id);
|
||||
export default function deleteQuizLPCategories(id: string): Promise<boolean> {
|
||||
return pb.collection(COL_QUIZ_LP_CATEGORIES).delete(id);
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { COL_LISTENINGS_PRACTICE_CATEGORIES } from '@/constants';
|
||||
import { COL_QUIZ_LP_CATEGORIES } from '@/constants';
|
||||
import type { RecordModel } from 'pocketbase';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default function getAllQuizListenings(): Promise<RecordModel[]> {
|
||||
return pb.collection(COL_LISTENINGS_PRACTICE_CATEGORIES).getFullList();
|
||||
return pb.collection(COL_QUIZ_LP_CATEGORIES).getFullList();
|
||||
}
|
||||
|
@@ -1,9 +1,9 @@
|
||||
// REQ0006
|
||||
import { COL_LISTENINGS_PRACTICE_CATEGORIES } from '@/constants';
|
||||
import { COL_QUIZ_LP_CATEGORIES } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function GetAllCount(): Promise<number> {
|
||||
const { totalItems: count } = await pb.collection(COL_LISTENINGS_PRACTICE_CATEGORIES).getList(1, 9999, {});
|
||||
const { totalItems: count } = await pb.collection(COL_QUIZ_LP_CATEGORIES).getList(1, 9999, {});
|
||||
return count;
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { COL_LISTENINGS_PRACTICE_CATEGORIES } from '@/constants';
|
||||
import { COL_QUIZ_LP_CATEGORIES } from '@/constants';
|
||||
import type { RecordModel } from 'pocketbase';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default function getQuizListeningById(id: string): Promise<RecordModel> {
|
||||
return pb.collection(COL_LISTENINGS_PRACTICE_CATEGORIES).getOne(id);
|
||||
return pb.collection(COL_QUIZ_LP_CATEGORIES).getOne(id);
|
||||
}
|
||||
|
@@ -1,13 +1,11 @@
|
||||
// REQ0006
|
||||
import { COL_LISTENINGS_PRACTICE_CATEGORIES } from '@/constants';
|
||||
import { COL_QUIZ_LP_CATEGORIES } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function GetHiddenCount(): Promise<number> {
|
||||
try {
|
||||
const result = await pb
|
||||
.collection(COL_LISTENINGS_PRACTICE_CATEGORIES)
|
||||
.getList(1, 9999, { filter: 'visible = "hidden"' });
|
||||
const result = await pb.collection(COL_QUIZ_LP_CATEGORIES).getList(1, 9999, { filter: 'visible = "hidden"' });
|
||||
const { totalItems: count } = result;
|
||||
return count;
|
||||
} catch (error) {
|
||||
|
@@ -1,13 +1,11 @@
|
||||
// REQ0006
|
||||
import { COL_LISTENINGS_PRACTICE_CATEGORIES } from '@/constants';
|
||||
import { COL_QUIZ_LP_CATEGORIES } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function GetVisibleCount(): Promise<number> {
|
||||
try {
|
||||
const result = await pb
|
||||
.collection(COL_LISTENINGS_PRACTICE_CATEGORIES)
|
||||
.getList(1, 9999, { filter: 'visible = "visible"' });
|
||||
const result = await pb.collection(COL_QUIZ_LP_CATEGORIES).getList(1, 9999, { filter: 'visible = "visible"' });
|
||||
const { totalItems: count } = result;
|
||||
return count;
|
||||
} catch (error) {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { COL_LISTENINGS_PRACTICE_CATEGORIES } from '@/constants';
|
||||
import { COL_QUIZ_LP_CATEGORIES } from '@/constants';
|
||||
import type { ListResult, RecordModel } from 'pocketbase';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
@@ -18,5 +18,5 @@ export default function listWithOption({
|
||||
rowsPerPage,
|
||||
listOption = {},
|
||||
}: ListWithOptionParams): Promise<ListResult<RecordModel>> {
|
||||
return pb.collection(COL_LISTENINGS_PRACTICE_CATEGORIES).getList(currentPage + 1, rowsPerPage, listOption);
|
||||
return pb.collection(COL_QUIZ_LP_CATEGORIES).getList(currentPage + 1, rowsPerPage, listOption);
|
||||
}
|
||||
|
7
002_source/cms/src/db/QuizMFCategories/Delete.tsx
Normal file
7
002_source/cms/src/db/QuizMFCategories/Delete.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { COL_QUIZ_MF_CATEGORIES } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default function deleteQuizMFCategories(id: string): Promise<boolean> {
|
||||
return pb.collection(COL_QUIZ_MF_CATEGORIES).delete(id);
|
||||
}
|
9
002_source/cms/src/db/QuizMFCategories/GetAllCount.tsx
Normal file
9
002_source/cms/src/db/QuizMFCategories/GetAllCount.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
// REQ0006
|
||||
import { COL_QUIZ_MF_CATEGORIES } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function GetAllCount(): Promise<number> {
|
||||
const { totalItems: count } = await pb.collection(COL_QUIZ_MF_CATEGORIES).getList(1, 9999, {});
|
||||
return count;
|
||||
}
|
14
002_source/cms/src/db/QuizMFCategories/GetHiddenCount.tsx
Normal file
14
002_source/cms/src/db/QuizMFCategories/GetHiddenCount.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
// REQ0006
|
||||
import { COL_QUIZ_MF_CATEGORIES } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function GetHiddenCount(): Promise<number> {
|
||||
try {
|
||||
const result = await pb.collection(COL_QUIZ_MF_CATEGORIES).getList(1, 9999, { filter: 'visible = "hidden"' });
|
||||
const { totalItems: count } = result;
|
||||
return count;
|
||||
} catch (error) {
|
||||
return 0;
|
||||
}
|
||||
}
|
14
002_source/cms/src/db/QuizMFCategories/GetVisibleCount.tsx
Normal file
14
002_source/cms/src/db/QuizMFCategories/GetVisibleCount.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
// REQ0006
|
||||
import { COL_QUIZ_MF_CATEGORIES } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function GetVisibleCount(): Promise<number> {
|
||||
try {
|
||||
const result = await pb.collection(COL_QUIZ_MF_CATEGORIES).getList(1, 9999, { filter: 'visible = "visible"' });
|
||||
const { totalItems: count } = result;
|
||||
return count;
|
||||
} catch (error) {
|
||||
return 0;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user