Empty Phone Number Validation

Separated the null check from the area code check so that when the field is null the 'required' popup will be displayed.
This commit is contained in:
The_Grits 2016-10-26 14:15:54 -04:00 committed by GitHub
parent fa1b6c6c00
commit 10e49d87b3

View file

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