fix: return 404 error when admin user is not found during complex creation

This commit is contained in:
Jose Selesan
2026-04-21 16:11:14 -03:00
parent 0aecbfa3dd
commit 0fd72ea1de

View File

@@ -25,7 +25,10 @@ export async function createComplexHandler(c: AppContext) {
where: { email: adminEmail }, where: { email: adminEmail },
select: { id: true }, select: { id: true },
}); });
userId = existingUser?.id; if (!existingUser) {
return c.json({ message: 'El usuario no existe.' }, 404);
}
userId = existingUser.id;
} }
const complex = await createComplex({ const complex = await createComplex({