Started working on the assignments page

This commit is contained in:
Tiago Ribeiro
2024-10-02 19:20:05 +01:00
parent 564e6438cb
commit 3d4a604aa2
25 changed files with 2225 additions and 688 deletions

View File

@@ -84,6 +84,12 @@ export const getAllAssignersByCorporate = async (corporateID: string, type: Type
return [...linkedTeachers.users.map((x) => x.id), ...linkedCorporates.users.map((x) => x.id)];
};
export const getGroupsForEntities = async (ids: string[]) =>
await db
.collection("groups")
.find<Group>({entity: {$in: ids}})
.toArray();
export const getGroupsForUser = async (admin?: string, participant?: string) => {
if (admin && participant) return await db.collection("groups").find<Group>({admin, participant}).toArray();