From 95e2c45d8df91a24c530b8b6b2b12c297dc5cb04 Mon Sep 17 00:00:00 2001 From: Samuel Thompson Date: Sun, 3 Nov 2024 17:30:06 -0600 Subject: [PATCH] Rename file upload functions --- app/src/pages/CreateWorkshop.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/pages/CreateWorkshop.tsx b/app/src/pages/CreateWorkshop.tsx index a98ffed..4bc3539 100644 --- a/app/src/pages/CreateWorkshop.tsx +++ b/app/src/pages/CreateWorkshop.tsx @@ -22,18 +22,18 @@ const CreateWorkshop = () => { const [success, setSuccess] = useState(false) const [errorMessage, setErrorMessage] = useState("") - const initialValues2 = { + const fileUploadInitialValues = { title: "", desc: "", file: "", } - const validationSchema2 = Yup.object().shape({ + const fileValidation = Yup.object().shape({ title: Yup.string().required("Title is required"), desc: Yup.string().required("Description is required"), file: Yup.mixed().required("Please select a file") }) - const handleSubmit2 = async (values: any, { resetForm }: any) => { + const handleFileSumbit = async (values: any, { resetForm }: any) => { setIsLoading(true) setErrorMessage("") // Clear error message at the start of submission @@ -62,9 +62,9 @@ const CreateWorkshop = () => { action={() => setIsModal(false)} body={ {({ values, errors, touched, isSubmitting }) => (