From 086392c56134e5161465c41d71c600074e5fc929 Mon Sep 17 00:00:00 2001 From: Katie Date: Tue, 12 Jul 2022 15:21:57 -0400 Subject: [PATCH] CSR-729 Save registration address to service by default, only save service location on vin-lookup if service zip hasn't changed --- src/layouts/address-lookup/address-lookup.vue | 2 ++ src/layouts/vin-lookup/vin-lookup.vue | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index 849e5772f..74ebd43de 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -265,6 +265,8 @@ export default { await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.customerQuestions.emailAddress, false); await this.dispatchStoreAction(storeActions.SAVE_SERVICE_LOCATION, { + address: this.customerQuestions.addressQuestions.streetAddress, + city: this.customerQuestions.addressQuestions.city, zipCode: this.serviceZipCode, state: resultMap.serviceZipValidationResponse.state, }, false); diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index e854f034e..fef6b0a68 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -351,10 +351,12 @@ export default { if (zipValidationResponse.data.isServiceable) { // If the Service Zip entered is serviceable then save the Zip Info and Email Address and navigate forward - await this.dispatchStoreAction(storeActions.SAVE_SERVICE_LOCATION, { - zipCode: this.zip, - state: zipValidationResponse.data.state - }, false); + if (this.$store.getters.order.serviceLocation.zipCode != this.zip) { + await this.dispatchStoreAction(storeActions.SAVE_SERVICE_LOCATION, { + zipCode: this.zip, + state: zipValidationResponse.data.state + }, false); + } await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.email, false);