Skip to content
Snippets Groups Projects
Commit 7ec55002 authored by michael.minelli's avatar michael.minelli
Browse files

ExerciseManager => Add function to get all exercises of an assignment

parent ac7fe3d0
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,15 @@ class ExerciseManager { ...@@ -12,6 +12,15 @@ class ExerciseManager {
include: include include: include
}) as unknown as Exercise ?? undefined; }) as unknown as Exercise ?? undefined;
} }
async getFromAssignment(assignmentName: string, include: Prisma.ExerciseInclude | undefined = undefined): Promise<Array<Exercise> | undefined> {
return await db.exercise.findMany({
where : {
assignmentName: assignmentName
},
include: include
}) as Array<Exercise> ?? undefined;
}
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment