Merge branch 'dev' into prod
This commit is contained in:
@@ -51,6 +51,7 @@ export const confirmUser = async (username) => {
|
|||||||
EMail Varchar(100) NOT NULL,
|
EMail Varchar(100) NOT NULL,
|
||||||
Telefonnummer Varchar(100) NOT NULL,
|
Telefonnummer Varchar(100) NOT NULL,
|
||||||
Lose INT NOT NULL,
|
Lose INT NOT NULL,
|
||||||
|
Schokolade BOOLEAN NOT NULL,
|
||||||
Firmenname Varchar(100),
|
Firmenname Varchar(100),
|
||||||
Vorname_Geschaeftlich Varchar(100),
|
Vorname_Geschaeftlich Varchar(100),
|
||||||
Nachname_Geschaeftlich Varchar(100),
|
Nachname_Geschaeftlich Varchar(100),
|
||||||
@@ -93,7 +94,7 @@ export const newEntry = async (formData, username, prizeDraw) => {
|
|||||||
const tableName = confirmation.tableName;
|
const tableName = confirmation.tableName;
|
||||||
|
|
||||||
const [result] = await pool.query(
|
const [result] = await pool.query(
|
||||||
`INSERT INTO ?? (Verlosung, Vorname, Nachname, EMail, Telefonnummer, Lose, Firmenname, Vorname_Geschaeftlich, Nachname_Geschaeftlich, EMail_Geschaeftlich, Telefonnummer_Geschaeftlich, Strasse_Hausnr, Plz_Ort, Zahlungsmethode) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
`INSERT INTO ?? (Verlosung, Vorname, Nachname, EMail, Telefonnummer, Lose, Schokolade, Firmenname, Vorname_Geschaeftlich, Nachname_Geschaeftlich, EMail_Geschaeftlich, Telefonnummer_Geschaeftlich, Strasse_Hausnr, Plz_Ort, Zahlungsmethode) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
||||||
[
|
[
|
||||||
tableName,
|
tableName,
|
||||||
prizeDraw,
|
prizeDraw,
|
||||||
@@ -102,6 +103,7 @@ export const newEntry = async (formData, username, prizeDraw) => {
|
|||||||
formData.email,
|
formData.email,
|
||||||
formData.phoneNumber,
|
formData.phoneNumber,
|
||||||
formData.tickets,
|
formData.tickets,
|
||||||
|
formData.chocolates,
|
||||||
formData.companyName,
|
formData.companyName,
|
||||||
formData.cmpFirstName,
|
formData.cmpFirstName,
|
||||||
formData.cpmLastName,
|
formData.cpmLastName,
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ export const createFormSchema = (
|
|||||||
email: z.email(t("email-error")),
|
email: z.email(t("email-error")),
|
||||||
phoneNumber: z.string(t("phone-error")).refine(validator.isMobilePhone),
|
phoneNumber: z.string(t("phone-error")).refine(validator.isMobilePhone),
|
||||||
tickets: z.number(t("ticket-error")).min(1),
|
tickets: z.number(t("ticket-error")).min(1),
|
||||||
|
chocolates: z.boolean(t("chocolates-error")),
|
||||||
companyName: invoice
|
companyName: invoice
|
||||||
? z.string().min(1, t("name-error"))
|
? z.string().min(1, t("name-error"))
|
||||||
: z.string().optional(),
|
: z.string().optional(),
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ export const MainForm = () => {
|
|||||||
email: "",
|
email: "",
|
||||||
phoneNumber: "",
|
phoneNumber: "",
|
||||||
tickets: 1,
|
tickets: 1,
|
||||||
|
chocolates: false,
|
||||||
companyName: "",
|
companyName: "",
|
||||||
cmpFirstName: "",
|
cmpFirstName: "",
|
||||||
cpmLastName: "",
|
cpmLastName: "",
|
||||||
@@ -316,7 +317,7 @@ export const MainForm = () => {
|
|||||||
)}
|
)}
|
||||||
</Field>
|
</Field>
|
||||||
|
|
||||||
{/* Tickets + Invoice toggle */}
|
{/* Tickets + Invoice + Chocolate toggle */}
|
||||||
<div className="grid grid-cols-2 gap-3 items-end">
|
<div className="grid grid-cols-2 gap-3 items-end">
|
||||||
<FormControl required>
|
<FormControl required>
|
||||||
<FormLabel>{t("tickets")}</FormLabel>
|
<FormLabel>{t("tickets")}</FormLabel>
|
||||||
@@ -349,7 +350,7 @@ export const MainForm = () => {
|
|||||||
}}
|
}}
|
||||||
</Field>
|
</Field>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<div className="flex items-center pb-2">
|
<div className="flex flex-col gap-2 pb-2">
|
||||||
<Checkbox
|
<Checkbox
|
||||||
checked={invoice}
|
checked={invoice}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
@@ -368,6 +369,16 @@ export const MainForm = () => {
|
|||||||
label={t("invoice")}
|
label={t("invoice")}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
/>
|
/>
|
||||||
|
<Field name="chocolates">
|
||||||
|
{(field) => (
|
||||||
|
<Checkbox
|
||||||
|
checked={!!field.state.value}
|
||||||
|
onChange={(e) => field.handleChange(e.target.checked)}
|
||||||
|
label={t("chocolates")}
|
||||||
|
variant="outlined"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Field>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -35,5 +35,7 @@
|
|||||||
"name-error": "Sie müssen einen Namen eingeben!",
|
"name-error": "Sie müssen einen Namen eingeben!",
|
||||||
"email-error": "Sie müssen eine gültige E-Mail Adresse eingeben!",
|
"email-error": "Sie müssen eine gültige E-Mail Adresse eingeben!",
|
||||||
"phone-error": "Sie müssen eine gültige Telefonnummer eingeben!",
|
"phone-error": "Sie müssen eine gültige Telefonnummer eingeben!",
|
||||||
"footer-headline": "Dieses System wurde vollständig konzipiert und entwickelt von Theis Gaedigk. - Portfolio: "
|
"footer-headline": "Dieses System wurde vollständig konzipiert und entwickelt von Theis Gaedigk. - Portfolio: ",
|
||||||
|
"chocolates": "Schokoladen",
|
||||||
|
"chocolates-error": "Dieses Feld kann nur wahr oder falsch sein."
|
||||||
}
|
}
|
||||||
@@ -36,5 +36,7 @@
|
|||||||
"name-error": "You have to enter a name!",
|
"name-error": "You have to enter a name!",
|
||||||
"email-error": "You have to enter a valid E-Mail adress!",
|
"email-error": "You have to enter a valid E-Mail adress!",
|
||||||
"phone-error": "You have to enter a vaild phone number!",
|
"phone-error": "You have to enter a vaild phone number!",
|
||||||
"footer-headline": "This system was fully designed and developed by Theis Gaedigk. - Portfolio: "
|
"footer-headline": "This system was fully designed and developed by Theis Gaedigk. - Portfolio: ",
|
||||||
|
"chocolates": "Chocolates",
|
||||||
|
"chocolates-error": "This field can only be true or false."
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user