mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-24 12:35:31 +00:00
fix: parent's email, telephone validation
This commit is contained in:
parent
326aef5483
commit
54752a50d3
1 changed files with 3 additions and 3 deletions
|
|
@ -71,7 +71,7 @@
|
|||
gdpr: yup.boolean().oneOf([true]),
|
||||
candidate: yup.object().shape({
|
||||
name: yup.string().required(),
|
||||
surname: yup.string(),
|
||||
surname: yup.string().required(),
|
||||
email: yup.string().email().required(),
|
||||
telephone: yup
|
||||
.string()
|
||||
|
|
@ -106,13 +106,13 @@
|
|||
.string()
|
||||
.email()
|
||||
.test((_val, context) => {
|
||||
if (context.path.includes('parents[1]')) {
|
||||
if (context.path.includes('parents[1]') && _val === '') {
|
||||
return true;
|
||||
}
|
||||
return _val !== '';
|
||||
}),
|
||||
telephone: yup.string().test((_val, context) => {
|
||||
if (context.path.includes('parents[1]')) {
|
||||
if (context.path.includes('parents[1]') && _val === '') {
|
||||
return true;
|
||||
}
|
||||
return _val?.match(/^\+\d{1,3} \d{3} \d{3} \d{3}$/) !== null;
|
||||
|
|
|
|||
Loading…
Reference in a new issue