feat: groepen van een leerling geimplmenteerd in backend
This commit is contained in:
parent
1b096b411b
commit
22cdf58fed
3 changed files with 71 additions and 28 deletions
|
@ -1,6 +1,7 @@
|
|||
import { DwengoEntityRepository } from '../dwengo-entity-repository.js';
|
||||
import { Group } from '../../entities/assignments/group.entity.js';
|
||||
import { Assignment } from '../../entities/assignments/assignment.entity.js';
|
||||
import { Student } from '../../entities/users/student.entity.js';
|
||||
|
||||
export class GroupRepository extends DwengoEntityRepository<Group> {
|
||||
public findByAssignmentAndGroupNumber(
|
||||
|
@ -23,6 +24,14 @@ export class GroupRepository extends DwengoEntityRepository<Group> {
|
|||
populate: ['members'],
|
||||
});
|
||||
}
|
||||
public findAllGroupsWithStudent(
|
||||
student: Student
|
||||
): Promise<Group[]> {
|
||||
return this.find(
|
||||
{ members: student },
|
||||
{ populate: ['members'] }
|
||||
)
|
||||
}
|
||||
public deleteByAssignmentAndGroupNumber(
|
||||
assignment: Assignment,
|
||||
groupNumber: number
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue