feat: class/:id service en controller laag geimplementeerd (BEVAT NOG BUG)

This commit is contained in:
Adriaan Jacquet 2025-03-04 16:32:59 +01:00
parent ceef74f1af
commit e9d9e52f9d
5 changed files with 60 additions and 33 deletions

View file

@ -0,0 +1,12 @@
import { getClassRepository } from "../data/repositories";
import { ClassDTO, mapToClassDTO } from "../interfaces/classes";
export async function getClass(classId: string): Promise<ClassDTO | null> {
const classRepository = getClassRepository();
const cls = await classRepository.findById(classId);
if (!cls) return null;
else {
return mapToClassDTO(cls);
}
}