ENCOA-267
This commit is contained in:
@@ -3,6 +3,7 @@ import { WithEntity } from "@/interfaces/entity";
|
||||
import { Assignment } from "@/interfaces/results";
|
||||
import { CorporateUser, Group, GroupWithUsers, MasterCorporateUser, StudentUser, TeacherUser, Type, User } from "@/interfaces/user";
|
||||
import client from "@/lib/mongodb";
|
||||
import { uniq } from "lodash";
|
||||
import moment from "moment";
|
||||
import { getLinkedUsers, getUser } from "./users.be";
|
||||
import { getSpecificUsers } from "./users.be";
|
||||
@@ -116,7 +117,7 @@ export const getUsersGroups = async (ids: string[]) => {
|
||||
export const convertToUsers = (group: Group, users: User[]): GroupWithUsers =>
|
||||
Object.assign(group, {
|
||||
admin: users.find((u) => u.id === group.admin),
|
||||
participants: group.participants.map((p) => users.find((u) => u.id === p)).filter((x) => !!x) as User[],
|
||||
participants: uniq(group.participants).map((p) => users.find((u) => u.id === p)).filter((x) => !!x) as User[],
|
||||
});
|
||||
|
||||
export const getAllAssignersByCorporate = async (corporateID: string, type: Type): Promise<string[]> => {
|
||||
|
||||
Reference in New Issue
Block a user