update,
This commit is contained in:
@@ -2,6 +2,9 @@ import { pb } from '@/lib/pb';
|
||||
import { COL_USER_METAS } from '@/constants';
|
||||
|
||||
export async function getAllTeachersCount(): Promise<number> {
|
||||
const result = await pb.collection(COL_USER_METAS).getList(1, 1, { filter: `role = "teacher"` });
|
||||
const result = await pb.collection(COL_USER_METAS).getList(1, 1, {
|
||||
filter: `role = "teacher"`,
|
||||
//
|
||||
});
|
||||
return result.totalItems;
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { COL_TEACHERS } from '@/constants';
|
||||
import { COL_USER_METAS } from '@/constants';
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function GetBlockedCount(): Promise<number> {
|
||||
const { totalItems: count } = await pb.collection(COL_TEACHERS).getList(1, 1, {
|
||||
const { totalItems: count } = await pb.collection(COL_USER_METAS).getList(1, 1, {
|
||||
filter: 'status = "blocked"',
|
||||
});
|
||||
return count;
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import { COL_CUSTOMERS } from '@/constants';
|
||||
import { COL_USER_METAS } from '@/constants';
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function GetPendingCount(): Promise<number> {
|
||||
const { totalItems: count } = await pb.collection(COL_CUSTOMERS).getList(1, 1, {
|
||||
filter: 'status = "pending"',
|
||||
const { totalItems: count } = await pb.collection(COL_USER_METAS).getList(1, 1, {
|
||||
filter: 'status = "pending" && role = "teacher"',
|
||||
});
|
||||
return count;
|
||||
}
|
||||
|
Reference in New Issue
Block a user