diff --git a/client/src/components/application/NonlinearStepper/ProInfos.js b/client/src/components/application/NonlinearStepper/ProInfos.js index b5c0342..f180d09 100644 --- a/client/src/components/application/NonlinearStepper/ProInfos.js +++ b/client/src/components/application/NonlinearStepper/ProInfos.js @@ -56,7 +56,7 @@ const ProInfos = ({ handleFormInput, formValues, errorMsg }) => ( name="jobTitle" message="Write [No] if you are not employed" onChange={handleFormInput} - isError={errorMsg.includes(`if you don't have job just write N/A`)} + isError={errorMsg.includes(`if you don't have job just write [ No ]`)} /> ); diff --git a/client/src/components/application/NonlinearStepper/index.js b/client/src/components/application/NonlinearStepper/index.js index 5b0998f..be0b1f3 100644 --- a/client/src/components/application/NonlinearStepper/index.js +++ b/client/src/components/application/NonlinearStepper/index.js @@ -94,6 +94,7 @@ export default function HorizontalNonLinearStepper({ userID, UserData }) { } const handleSubmit = async (values) => { + throwAlert(false); const { gender, fullName, @@ -136,9 +137,11 @@ export default function HorizontalNonLinearStepper({ userID, UserData }) { }); history.push('/accounts'); } catch (error) { + throwAlert(true); setMessage(error.message); } } catch ({ errors }) { + throwAlert(true); setErrMsg(errors); setMessage(errors[0]); } diff --git a/client/src/utils/application/nLinearStepperValidation.js b/client/src/utils/application/nLinearStepperValidation.js index d72d397..ce0f691 100644 --- a/client/src/utils/application/nLinearStepperValidation.js +++ b/client/src/utils/application/nLinearStepperValidation.js @@ -17,8 +17,8 @@ const generalInfosSchema = yup.object().shape({ age: yup.string().required('Age is required').trim(), address: yup.string().required('Address is required'), motivation: yup.string().required('Insert motivation').trim(), - specialization: yup.string().required(`Insert your Specialization`).trim(), university: yup.string().required(`Select your university`).trim(), + specialization: yup.string().required(`Insert your Specialization`).trim(), codingExperience: yup .string() .required(`Select your coding experience`) @@ -33,11 +33,8 @@ const generalInfosSchema = yup.object().shape({ .trim(), cvLink: yup .string() - .matches( - /^((https?):\/\/)?(www.)?[a-z0-9]+(\.[a-z]{2,}){1,3}(#?\/?[a-zA-Z0-9#]+)*\/?(\?[a-zA-Z0-9-_]+=[a-zA-Z0-9-%]+&?)?$/, - 'Enter correct url!' - ) .required(`Insert Your Cv Link first`) + .url('Enter a valid URL!') .trim(), }); @@ -49,8 +46,8 @@ const prosInfoSchema = yup.object().shape({ employmentStatus: yup.string().required('Current Employment is required'), jobTitle: yup .string() - .nullable() .required(`if you don't have job just write [ No ]`) + .nullable() .trim(), });