update teachers,
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { pb } from '@/lib/pb';
|
||||
import { COL_TEACHERS } from '@/constants';
|
||||
import { COL_USER_METAS } from '@/constants';
|
||||
|
||||
export async function deleteTeacher(id: string): Promise<boolean> {
|
||||
return pb.collection(COL_TEACHERS).delete(id);
|
||||
return pb.collection(COL_USER_METAS).delete(id);
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { COL_TEACHERS } from '@/constants';
|
||||
import { COL_TEACHERS, COL_USER_METAS } from '@/constants';
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function GetActiveCount(): 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 = "active"',
|
||||
});
|
||||
return count;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { pb } from '@/lib/pb';
|
||||
import { COL_TEACHERS } from '@/constants';
|
||||
import { COL_USER_METAS } from '@/constants';
|
||||
|
||||
export async function getAllTeachersCount(): Promise<number> {
|
||||
const result = await pb.collection(COL_TEACHERS).getList(1, 1);
|
||||
const result = await pb.collection(COL_USER_METAS).getList(1, 1, { filter: `role = "teacher"` });
|
||||
return result.totalItems;
|
||||
}
|
||||
|
Reference in New Issue
Block a user