Solved a problem with the assignees stuff related to the query

This commit is contained in:
Tiago Ribeiro
2024-11-07 12:51:14 +00:00
parent fae7b729fe
commit 78cf011bf7
2 changed files with 46 additions and 46 deletions

View File

@@ -30,7 +30,7 @@ export const getAssignment = async (id: string) => {
export const getAssignmentsByAssignee = async (id: string, filter?: { [key in keyof Partial<Assignment>]: any }) => { export const getAssignmentsByAssignee = async (id: string, filter?: { [key in keyof Partial<Assignment>]: any }) => {
return await db return await db
.collection("assignments") .collection("assignments")
.find<Assignment>({assignees: [id], ...(!filter ? {} : filter)}) .find<Assignment>({ assignees: id, ...(!filter ? {} : filter) })
.toArray(); .toArray();
}; };