feat: Telefonnummer im Kontaktformular ist Pflicht
Docker-Images bauen und veroeffentlichen / build-and-push (push) Successful in 2m50s
Docker-Images bauen und veroeffentlichen / build-and-push (push) Successful in 2m50s
Gleiche Prüfung wie bei der Buchung: mindestens 6 Zeichen, nur Ziffern, Leerzeichen und + ( ) / -. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
20adfaa97e
commit
a47e91e9d5
3 files changed
+15
-5
No files matched your search
@@ -101,8 +101,8 @@ export function ContactSection() {
|
||||
{error("email")}
|
||||
</div>
|
||||
<div>
|
||||
<label className="field-label" htmlFor="ct-phone">Telefon (optional)</label>
|
||||
<input {...fieldProps("phone")} className="field" type="tel" autoComplete="tel" maxLength={60} />
|
||||
<label className="field-label" htmlFor="ct-phone">Telefon</label>
|
||||
<input {...fieldProps("phone")} className="field" type="tel" autoComplete="tel" required maxLength={40} />
|
||||
{error("phone")}
|
||||
</div>
|
||||
<div>
|
||||
|
||||
+7
-1
@@ -28,7 +28,13 @@ const optionalText = (max: number) =>
|
||||
export const contactRequestSchema = z.object({
|
||||
name: z.string().trim().min(2, "Bitte gib deinen Namen an.").max(120),
|
||||
email: z.string().trim().max(200).pipe(z.email("Bitte gib eine gültige E-Mail-Adresse an.")),
|
||||
phone: optionalText(60),
|
||||
// Gleiche Regel wie bei der Buchung.
|
||||
phone: z
|
||||
.string("Bitte gib eine Telefonnummer an.")
|
||||
.trim()
|
||||
.min(6, "Bitte gib eine Telefonnummer an.")
|
||||
.max(40)
|
||||
.regex(/^[+0-9 ()/-]+$/, "Die Telefonnummer darf nur Ziffern, Leerzeichen und + ( ) / - enthalten."),
|
||||
availability: optionalText(200),
|
||||
message: optionalText(2000),
|
||||
privacy: z.literal(true, { error: "Bitte bestätige die Datenschutzhinweise." }),
|
||||
|
||||
Reference in new issue
Block a user