fix: gefaalde testen voor class controller gefixt

This commit is contained in:
Adriaan Jacquet 2025-03-29 22:28:52 +01:00
parent 7a443c0686
commit 943dd04e97
4 changed files with 33 additions and 29 deletions

View file

@ -1,3 +1,4 @@
import { Class } from '../../entities/classes/class.entity.js';
import { Student } from '../../entities/users/student.entity.js';
import { User } from '../../entities/users/user.entity.js';
import { DwengoEntityRepository } from '../dwengo-entity-repository.js';
@ -9,6 +10,9 @@ export class StudentRepository extends DwengoEntityRepository<Student> {
public findByUsername(username: string): Promise<Student | null> {
return this.findOne({ username: username });
}
public findByClass(cls: Class): Promise<Student[]> {
return this.find({ classes: cls });
}
public deleteByUsername(username: string): Promise<void> {
return this.deleteWhere({ username: username });
}