feat: delete op class geimplementeerd

This commit is contained in:
Adriaan Jacquet 2025-04-01 17:06:26 +02:00
parent 6290d3dd9b
commit da5cb7d02d
3 changed files with 17 additions and 4 deletions

View file

@ -64,6 +64,10 @@ export async function createClass(classData: ClassDTO): Promise<ClassDTO | null>
export async function deleteClass(classId: string): Promise<ClassDTO> {
const cls = await fetchClass(classId);
if (!cls) {
throw new NotFoundException('Could not delete class because it does not exist');
}
const classRepository = getClassRepository();
await classRepository.deleteById(classId);