Improved a bit of the speed of the application
This commit is contained in:
@@ -60,6 +60,12 @@ export const getEntitiesAssignments = async (ids: string[]) => {
|
||||
.toArray();
|
||||
};
|
||||
|
||||
export const countEntitiesAssignments = async (ids: string[], filter?: object) => {
|
||||
return await db
|
||||
.collection("assignments")
|
||||
.countDocuments({ entity: { $in: ids }, ...(filter || {}) })
|
||||
};
|
||||
|
||||
export const getAssignmentsForCorporates = async (userType: Type, idsList: string[], startDate?: Date, endDate?: Date) => {
|
||||
const assigners = await Promise.all(
|
||||
idsList.map(async (id) => {
|
||||
|
||||
Reference in New Issue
Block a user