fix: werkende aan assignment fix

This commit is contained in:
Adriaan Jacquet 2025-04-09 18:31:06 +02:00
parent 45ca433e09
commit 69659426de
6 changed files with 44 additions and 21 deletions

View file

@ -4,10 +4,10 @@ import { Class } from '../../entities/classes/class.entity.js';
export class AssignmentRepository extends DwengoEntityRepository<Assignment> {
public async findByClassAndId(within: Class, id: number): Promise<Assignment | null> {
return this.findOne({ within: within, id: id });
return this.findOne({ within: within, id: id }, { populate: [ "groups" ]});
}
public async findAllAssignmentsInClass(within: Class): Promise<Assignment[]> {
return this.findAll({ where: { within: within } });
return this.findAll({ where: { within: within }, populate: [ "groups" ] });
}
public async deleteByClassAndId(within: Class, id: number): Promise<void> {
return this.deleteWhere({ within: within, id: id });