fix(backend): MikroORM-probleem bij het opvragen en dan toevoegen van submissions opgelost.

MikroORM genereerde een query met een syntaxfout wanneer men eerst een submission opvraagt en dan toevoegt.
This commit is contained in:
Gerald Schmittinger 2025-04-17 08:41:57 +02:00
parent 72c9d232be
commit 1685c518b6
4 changed files with 24 additions and 53 deletions

View file

@ -61,21 +61,17 @@ export class SubmissionRepository extends DwengoEntityRepository<Submission> {
/**
* Looks up all submissions for the given learning object which were submitted as part of the given assignment.
* When forStudentUsername is set, only the submissions of the given user's group are shown.
* When forGroup is set, only the submissions of the given group are shown.
*/
public async findAllSubmissionsForLearningObjectAndAssignment(
loId: LearningObjectIdentifier,
assignment: Assignment,
forStudentUsername?: string
forGroup?: number
): Promise<Submission[]> {
const onBehalfOf = forStudentUsername
const onBehalfOf = forGroup
? {
assignment,
members: {
$some: {
username: forStudentUsername,
},
},
groupNumber: forGroup
}
: {
assignment,