remove validateForm because is unused
This commit is contained in:
parent
3fce9ad750
commit
1edce23f4d
@ -3,37 +3,6 @@ import { Formik, Form, Field, ErrorMessage } from "formik";
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import ConfirmationPage from "./ConfimationPage";
|
import ConfirmationPage from "./ConfimationPage";
|
||||||
|
|
||||||
// Manuelle Validierung
|
|
||||||
const validateForm = (values) => {
|
|
||||||
const errors = {};
|
|
||||||
|
|
||||||
if (!values.kleidungsart) {
|
|
||||||
errors.kleidungsart = "Bitte wählen Sie eine Kleidungsart";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!values.krisengebiet) {
|
|
||||||
errors.krisengebiet = "Bitte wählen Sie ein Krisengebiet";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!values.lieferart) {
|
|
||||||
errors.lieferart = "Bitte wählen Sie eine Lieferart";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (values.lieferart === "Abholung") {
|
|
||||||
if (!values.abholadresse) {
|
|
||||||
errors.abholadresse = "Bitte geben Sie Ihre Abholadresse an";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!values.plz) {
|
|
||||||
errors.plz = "Bitte geben Sie eine PLZ an";
|
|
||||||
} else if (!/^\d{5}$/.test(values.plz)) {
|
|
||||||
errors.plz = "Die PLZ muss genau 5 Ziffern haben";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return errors;
|
|
||||||
};
|
|
||||||
|
|
||||||
const SpendenForm = () => {
|
const SpendenForm = () => {
|
||||||
const [isSubmitted, setIsSubmitted] = useState(false);
|
const [isSubmitted, setIsSubmitted] = useState(false);
|
||||||
const [spendenData, setSpendenData] = useState(null);
|
const [spendenData, setSpendenData] = useState(null);
|
||||||
|
Loading…
Reference in New Issue
Block a user