Solved a bug for the master statistical
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import {app} from "@/firebase";
|
||||
import {Assignment} from "@/interfaces/results";
|
||||
import {CorporateUser, Group, MasterCorporateUser, StudentUser, TeacherUser, User} from "@/interfaces/user";
|
||||
import {CorporateUser, Group, MasterCorporateUser, StudentUser, TeacherUser, Type, User} from "@/interfaces/user";
|
||||
import client from "@/lib/mongodb";
|
||||
import moment from "moment";
|
||||
import {getLinkedUsers, getUser} from "./users.be";
|
||||
@@ -71,9 +71,9 @@ export const getUsersGroups = async (ids: string[]) => {
|
||||
.toArray();
|
||||
};
|
||||
|
||||
export const getAllAssignersByCorporate = async (corporateID: string): Promise<string[]> => {
|
||||
const linkedTeachers = await getLinkedUsers(corporateID, "mastercorporate", "teacher");
|
||||
const linkedCorporates = await getLinkedUsers(corporateID, "mastercorporate", "corporate");
|
||||
export const getAllAssignersByCorporate = async (corporateID: string, type: Type): Promise<string[]> => {
|
||||
const linkedTeachers = await getLinkedUsers(corporateID, type, "teacher");
|
||||
const linkedCorporates = await getLinkedUsers(corporateID, type, "corporate");
|
||||
|
||||
return [...linkedTeachers.users.map((x) => x.id), ...linkedCorporates.users.map((x) => x.id)];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user