Rollback to fcb05034
This commit is contained in:
@@ -2614,10 +2614,9 @@ export const appRouter = router({
|
||||
}
|
||||
}
|
||||
|
||||
// Récupérer le formateur par email (insensible à la casse et aux espaces)
|
||||
// Récupérer le formateur par email
|
||||
if (!input.email) throw new Error("Email formateur requis");
|
||||
const emailNormalized = input.email.trim().toLowerCase();
|
||||
const formateurData = await db.select().from(formateurs).where(sql`LOWER(TRIM(${formateurs.email})) = ${emailNormalized}`).limit(1);
|
||||
const formateurData = await db.select().from(formateurs).where(eq(formateurs.email, input.email)).limit(1);
|
||||
if (formateurData.length === 0) {
|
||||
throw new Error("Formateur introuvable avec cet email");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user