Solved a bug for the master statistical
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import client from "@/lib/mongodb";
|
||||
import {Assignment} from "@/interfaces/results";
|
||||
import {getAllAssignersByCorporate} from "@/utils/groups.be";
|
||||
import {Type} from "@/interfaces/user";
|
||||
|
||||
const db = client.db(process.env.MONGODB_DB);
|
||||
|
||||
@@ -36,10 +37,10 @@ export const getAssignmentsByAssigners = async (ids: string[], startDate?: Date,
|
||||
.toArray();
|
||||
};
|
||||
|
||||
export const getAssignmentsForCorporates = async (idsList: string[], startDate?: Date, endDate?: Date) => {
|
||||
export const getAssignmentsForCorporates = async (userType: Type, idsList: string[], startDate?: Date, endDate?: Date) => {
|
||||
const assigners = await Promise.all(
|
||||
idsList.map(async (id) => {
|
||||
const assigners = await getAllAssignersByCorporate(id);
|
||||
const assigners = await getAllAssignersByCorporate(id, userType);
|
||||
return {
|
||||
corporateId: id,
|
||||
assigners,
|
||||
|
||||
Reference in New Issue
Block a user