Phone Number 'Required' Validation

This commit is contained in:
The_Grits 2016-11-04 11:51:48 -04:00 committed by GitHub
parent 10e49d87b3
commit 21941ecf86

View file

@ -455,14 +455,10 @@ module.exports = {
}; };
}, },
onValidSubmit: function (formData, reset, invalidate) { onValidSubmit: function (formData, reset, invalidate) {
if (!formData.phone) { if (!formData.phone || formData.phone.national_number === '+') {
return invalidate({ return invalidate({
'phone': this.props.intl.formatMessage({id: 'teacherRegistration.validationRequired'}) 'phone': this.props.intl.formatMessage({id: 'teacherRegistration.validationRequired'})
}); });
} else if (formData.phone.national_number === '+') {
return invalidate({
'phone': this.props.intl.formatMessage({id: 'teacherRegistration.validationPhoneNumber'})
});
} }
return this.props.onNextStep(formData); return this.props.onNextStep(formData);
}, },