Fix some phone/email bugs for new custorder page

This commit is contained in:
Lance Edgar 2021-10-10 20:21:41 -04:00
parent 7fabef6004
commit ffb33d00c8

View file

@ -153,7 +153,13 @@
<div class="level"> <div class="level">
<div class="level-left"> <div class="level-left">
<div class="level-item"> <div class="level-item">
{{ orderPhoneNumber }} <span v-if="orderPhoneNumber">
{{ orderPhoneNumber }}
</span>
<span v-if="!orderPhoneNumber"
class="has-text-danger">
(no valid phone number on file)
</span>
</div> </div>
% if allow_contact_info_choice: % if allow_contact_info_choice:
<div class="level-item" <div class="level-item"
@ -240,7 +246,7 @@
</span> </span>
<span v-if="!orderEmailAddress" <span v-if="!orderEmailAddress"
class="has-text-danger"> class="has-text-danger">
(no valid email on file) (no valid email address on file)
</span> </span>
</div> </div>
% if allow_contact_info_choice: % if allow_contact_info_choice:
@ -1035,7 +1041,7 @@
that.orderPhoneNumber = response.data.phone_number that.orderPhoneNumber = response.data.phone_number
that.orderEmailAddress = response.data.email_address that.orderEmailAddress = response.data.email_address
that.addOtherPhoneNumber = response.data.add_phone_number that.addOtherPhoneNumber = response.data.add_phone_number
that.addOtherEmailAddres = response.data.add_email_address that.addOtherEmailAddress = response.data.add_email_address
that.contactProfileURL = response.data.contact_profile_url that.contactProfileURL = response.data.contact_profile_url
that.contactPhones = response.data.contact_phones that.contactPhones = response.data.contact_phones
that.contactEmails = response.data.contact_emails that.contactEmails = response.data.contact_emails
@ -1051,7 +1057,7 @@
editPhoneNumberInit() { editPhoneNumberInit() {
this.existingPhoneUUID = null this.existingPhoneUUID = null
let normalOrderPhone = this.orderPhoneNumber.replace(/\D/g, '') let normalOrderPhone = (this.orderPhoneNumber || '').replace(/\D/g, '')
for (let phone of this.contactPhones) { for (let phone of this.contactPhones) {
let normal = phone.number.replace(/\D/g, '') let normal = phone.number.replace(/\D/g, '')
if (normal == normalOrderPhone) { if (normal == normalOrderPhone) {