fix: juiste responsecodes en messages toegevoegd

This commit is contained in:
Adriaan Jacquet 2025-03-23 19:49:41 +01:00
parent 59e8f2fcf2
commit 1664642940
9 changed files with 61 additions and 17 deletions

View file

@ -58,6 +58,14 @@ export async function createStudentHandler(req: Request, res: Response) {
}
const newUser = await createStudent(userData);
if (!newUser) {
res.status(500).json({
error: 'Something went wrong while creating student'
});
return;
}
res.status(201).json(newUser);
}