fix: integratie user + errors gefixt zodat het runt + format

This commit is contained in:
Gabriellvl 2025-03-09 23:59:31 +01:00
parent 6c4ea0eefb
commit 1b096b411b
55 changed files with 858 additions and 594 deletions

View file

@ -1,13 +1,13 @@
import { DwengoEntityRepository } from '../dwengo-entity-repository.js';
import { Class } from '../../entities/classes/class.entity.js';
import { Student } from '../../entities/users/student.entity.js';
import {Teacher} from "../../entities/users/teacher.entity";
import { Teacher } from '../../entities/users/teacher.entity';
export class ClassRepository extends DwengoEntityRepository<Class> {
public findById(id: string): Promise<Class | null> {
return this.findOne(
{ classId: id },
{ populate: ["students", "teachers"] },
{ populate: ['students', 'teachers'] }
);
}
public deleteById(id: string): Promise<void> {
@ -16,14 +16,14 @@ export class ClassRepository extends DwengoEntityRepository<Class> {
public findByStudent(student: Student): Promise<Class[]> {
return this.find(
{ students: student },
{ populate: ["students", "teachers"] } // voegt student en teacher objecten toe
)
{ populate: ['students', 'teachers'] } // Voegt student en teacher objecten toe
);
}
public findByTeacher(teacher: Teacher): Promise<Class[]> {
return this.find(
{ teachers: teacher },
{ populate: ["students", "teachers"] }
{ populate: ['students', 'teachers'] }
);
}
}