CASH-176 clear email/phone field on all pages, not just service zip
This commit is contained in:
CarlNation 2025-02-18 13:54:42 -05:00
parent e770a5bc09
commit b2459ffcf6
3 changed files with 48 additions and 24 deletions

View file

@ -357,15 +357,18 @@ export default {
false false
); );
// if no value due to field being optional, blank both phone and email address
if (!this.customerQuestions.emailOrSms) {
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false);
}
else {
if (vinPagesMixin.methods.isPhoneNumber(this.customerQuestions.emailOrSms)) { if (vinPagesMixin.methods.isPhoneNumber(this.customerQuestions.emailOrSms)) {
const phone = this.customerQuestions.emailOrSms.replace(/[()]/g, ""); const phone = this.customerQuestions.emailOrSms.replace(/[()]/g, "");
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false); await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
} else { } else {
await this.dispatchStoreAction( await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.customerQuestions.emailOrSms, false);
storeActions.SAVE_EMAIL, }
this.customerQuestions.emailOrSms,
false
);
} }
await this.dispatchStoreAction( await this.dispatchStoreAction(

View file

@ -311,12 +311,19 @@ export default {
false false
); );
// if no value due to field being optional, blank both phone and email address
if (!this.emailOrSms) {
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false);
}
else {
if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) { if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) {
const phone = this.emailOrSms.replace(/[()]/g, ""); const phone = this.emailOrSms.replace(/[()]/g, "");
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false); await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
} else { } else {
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailOrSms, false); await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailOrSms, false);
} }
}
await this.dispatchStoreAction( await this.dispatchStoreAction(
storeActions.SAVE_PAGE_DATA, storeActions.SAVE_PAGE_DATA,

View file

@ -330,12 +330,19 @@ export default {
false false
); );
// if no value due to field being optional, blank both phone and email address
if (!this.emailOrSms) {
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false);
}
else {
if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) { if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) {
const phone = this.emailOrSms.replace(/[()]/g, ""); const phone = this.emailOrSms.replace(/[()]/g, "");
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false); await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
} else { } else {
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailOrSms, false); await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailOrSms, false);
} }
}
await this.dispatchStoreAction( await this.dispatchStoreAction(
storeActions.SAVE_PAGE_DATA, storeActions.SAVE_PAGE_DATA,
@ -380,12 +387,19 @@ export default {
); );
} }
// if no value due to field being optional, blank both phone and email address
if (!this.emailOrSms) {
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false);
}
else {
if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) { if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) {
const phone = this.emailOrSms.replace(/[()]/g, ""); const phone = this.emailOrSms.replace(/[()]/g, "");
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false); await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
} else { } else {
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailOrSms, false); await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailOrSms, false);
} }
}
await this.dispatchStoreAction( await this.dispatchStoreAction(
storeActions.SAVE_PAGE_DATA, storeActions.SAVE_PAGE_DATA,