// REQ0006
import { COL_LESSON_TYPES } from '@/constants';

import { pb } from '@/lib/pb';

export default async function GetVisibleCount(): Promise<number> {
  try {
    const result = await pb.collection(COL_LESSON_TYPES).getList(1, 9999, { filter: 'visible = "visible"' });
    const { totalItems: count } = result;
    return count;
  } catch (error) {
    return 0;
  }
}
