Skip to content

Commit

Permalink
fixed cvLink validation and alert bug
Browse files Browse the repository at this point in the history
relates #194
  • Loading branch information
alidah0 committed Jun 10, 2020
1 parent 279301e commit 4c7447e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]`)}
/>
</div>
);
Expand Down
3 changes: 3 additions & 0 deletions client/src/components/application/NonlinearStepper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export default function HorizontalNonLinearStepper({ userID, UserData }) {
}

const handleSubmit = async (values) => {
throwAlert(false);
const {
gender,
fullName,
Expand Down Expand Up @@ -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]);
}
Expand Down
9 changes: 3 additions & 6 deletions client/src/utils/application/nLinearStepperValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand All @@ -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(),
});

Expand All @@ -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(),
});

Expand Down

0 comments on commit 4c7447e

Please sign in to comment.