feat: endpoints voor /, /:id en /:id/students in routes/class.ts zijn geimplementeerd
This commit is contained in:
parent
123fdf0fa1
commit
241fe0103f
7 changed files with 95 additions and 34 deletions
|
@ -4,7 +4,10 @@ import { Student } from '../../entities/users/student.entity.js';
|
|||
|
||||
export class ClassRepository extends DwengoEntityRepository<Class> {
|
||||
public findById(id: string): Promise<Class | null> {
|
||||
return this.findOne({ classId: id });
|
||||
return this.findOne(
|
||||
{ classId: id },
|
||||
{ populate: ["students", "teachers"] },
|
||||
);
|
||||
}
|
||||
public deleteById(id: string): Promise<void> {
|
||||
return this.deleteWhere({ classId: id });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue