fix: return 404 error when admin user is not found during complex creation
This commit is contained in:
@@ -25,7 +25,10 @@ export async function createComplexHandler(c: AppContext) {
|
||||
where: { email: adminEmail },
|
||||
select: { id: true },
|
||||
});
|
||||
userId = existingUser?.id;
|
||||
if (!existingUser) {
|
||||
return c.json({ message: 'El usuario no existe.' }, 404);
|
||||
}
|
||||
userId = existingUser.id;
|
||||
}
|
||||
|
||||
const complex = await createComplex({
|
||||
|
||||
Reference in New Issue
Block a user