feat(backend): Functionaliteit toegevoegd om alle submissions zichtbaar voor een bepaalde leerling of leerkracht op te vragen.
This commit is contained in:
parent
03fa7c7b14
commit
9135b9c5b0
9 changed files with 338 additions and 156 deletions
|
@ -6,6 +6,19 @@ export class AssignmentRepository extends DwengoEntityRepository<Assignment> {
|
|||
public async findByClassAndId(within: Class, id: number): Promise<Assignment | null> {
|
||||
return this.findOne({ within: within, id: id });
|
||||
}
|
||||
public async findAllByResponsibleTeacher(teacherUsername: string): Promise<Assignment[]> {
|
||||
return this.findAll({
|
||||
where: {
|
||||
within: {
|
||||
teachers: {
|
||||
$some: {
|
||||
username: teacherUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
public async findAllAssignmentsInClass(within: Class): Promise<Assignment[]> {
|
||||
return this.findAll({ where: { within: within } });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue