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