Continued with the transformation of the Entities

This commit is contained in:
Tiago Ribeiro
2024-10-08 10:44:57 +01:00
parent 1ef4efcacf
commit c43ab9a911
13 changed files with 260 additions and 31 deletions

View File

@@ -85,6 +85,10 @@ export const getParticipantGroups = async (id: string) => {
return await db.collection("groups").find<Group>({ participants: id }).toArray();
};
export const getParticipantsGroups = async (ids: string[]) => {
return await db.collection("groups").find<Group>({ participants: { $in: ids } }).toArray();
};
export const getUserGroups = async (id: string): Promise<Group[]> => {
return await db.collection("groups").find<Group>({ admin: id }).toArray();
};