Skip to content
Merged
7 changes: 2 additions & 5 deletions app/components/forms/user-profile-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,12 @@ export default Component.extend(FormMixin, {
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Parth910 Just add

optional  : true,

Rest is done

Copy link
Member Author

@Parth910 Parth910 Aug 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for help, I made some unwanted changes. I have made requested changes.

phone: {
identifier : 'phone',
optional : true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need optional here?

rules : [
{
type : 'empty',
prompt : this.l10n.t('Please enter a phone number.')
},
{
type : 'regExp',
value : validPhoneNumber,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that after removing an "empty" type, a validator can't allow empty input in the phone field. so I just remove it and add inputtype=number.

prompt : this.l10n.t('Please enter a valid phone number.')
prompt : this.l10n.t('Please enter a valid phone number')
}
]
}
Expand Down