fix: juiste responsecodes en messages toegevoegd
This commit is contained in:
parent
59e8f2fcf2
commit
1664642940
9 changed files with 61 additions and 17 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue