Commit 30945bc0 authored by Matthew Taylor's avatar Matthew Taylor

Remove `phoneLength` validation

parent f49d6e6a
......@@ -25,8 +25,7 @@ var PhoneInput = React.createClass({
getDefaultProps: function () {
return {
validations: {
isPhone: true,
phoneLength: true
isPhone: true
},
flagsImagePath: '/images/flags.png',
defaultCountry: 'us'
......@@ -65,8 +64,7 @@ var PhoneInput = React.createClass({
});
var phoneValidationHOC = validationHOCFactory({
isPhone: <intl.FormattedMessage id="teacherRegistration.validationPhoneNumber" />,
phoneLength: <intl.FormattedMessage id="teacherRegistration.validationPhoneNumber" />
isPhone: <intl.FormattedMessage id="teacherRegistration.validationPhoneNumber" />
});
module.exports = inputHOC(defaultValidationHOC(phoneValidationHOC(PhoneInput)));
......@@ -21,14 +21,6 @@ module.exports.validations = {
return false;
}
return phoneNumberUtil.isValidNumber(parsed);
},
phoneLength: function (values, value) {
if (typeof value === 'undefined') return true;
if (value && value.national_number === '+') return true;
if (value && value.national_number.length === value.country_code.format.length) {
return true;
}
return false;
}
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment