feat: delete op class geimplementeerd
This commit is contained in:
parent
6290d3dd9b
commit
da5cb7d02d
3 changed files with 17 additions and 4 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue