fix+feat: error bij het toevegoen van groups na het aanmaken van een assignment gefixt, group & assignment DTO Id toegevoegd

This commit is contained in:
Adriaan Jacquet 2025-04-15 19:56:09 +02:00
parent 0ceb6761d7
commit e3fc4b72a7
8 changed files with 53 additions and 50 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 }, { populate: [ "groups" ]});
return this.findOne({ within: within, id: id }, { populate: [ "groups", "groups.members" ]});
}
public async findAllAssignmentsInClass(within: Class): Promise<Assignment[]> {
return this.findAll({ where: { within: within }, populate: [ "groups" ] });
return this.findAll({ where: { within: within }, populate: [ "groups", "groups.members" ] });
}
public async deleteByClassAndId(within: Class, id: number): Promise<void> {
return this.deleteWhere({ within: within, id: id });