merge: merge fix/183-post-assignment into dev
This commit is contained in:
commit
5a593cb88f
67 changed files with 2205 additions and 2129 deletions
|
@ -6,6 +6,22 @@ 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", "groups.members" ]});
|
||||
}
|
||||
public async findByClassIdAndAssignmentId(withinClass: string, id: number): Promise<Assignment | null> {
|
||||
return this.findOne({ within: { classId: withinClass }, 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 }, populate: [ "groups", "groups.members" ] });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue