update,
This commit is contained in:
@@ -4,8 +4,6 @@ import { COL_LESSON_CATEGORIES } from '@/constants';
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function GetAllCount(): Promise<number> {
|
||||
const { totalItems: count } = await pb
|
||||
.collection(COL_LESSON_CATEGORIES)
|
||||
.getList(1, 9999, { filter: 'visible = "visible"' });
|
||||
const { totalItems: count } = await pb.collection(COL_LESSON_CATEGORIES).getList(1, 9999, {});
|
||||
return count;
|
||||
}
|
||||
|
14
002_source/cms/src/db/LessonCategories/GetHiddenCount.tsx
Normal file
14
002_source/cms/src/db/LessonCategories/GetHiddenCount.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
// REQ0006
|
||||
import { COL_LESSON_CATEGORIES } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function GetHiddenCount(): Promise<number> {
|
||||
try {
|
||||
const result = await pb.collection(COL_LESSON_CATEGORIES).getList(1, 9999, { filter: 'visible = "hidden"' });
|
||||
const { totalItems: count } = result;
|
||||
return count;
|
||||
} catch (error) {
|
||||
return 0;
|
||||
}
|
||||
}
|
14
002_source/cms/src/db/LessonCategories/GetVisibleCount.tsx
Normal file
14
002_source/cms/src/db/LessonCategories/GetVisibleCount.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
// REQ0006
|
||||
import { COL_LESSON_CATEGORIES } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function GetVisibleCount(): Promise<number> {
|
||||
try {
|
||||
const result = await pb.collection(COL_LESSON_CATEGORIES).getList(1, 9999, { filter: 'visible = "visible"' });
|
||||
const { totalItems: count } = result;
|
||||
return count;
|
||||
} catch (error) {
|
||||
return 0;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user