From cc6ecd9918f814457f0610ea79c7e1369f7bba2e Mon Sep 17 00:00:00 2001 From: Katie Date: Wed, 13 Jul 2022 10:53:19 -0400 Subject: [PATCH] CSR-726 Clear serviceLocation address and city on vin-lookup unless zip matches registration zip --- src/layouts/vin-lookup/vin-lookup.vue | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index fef6b0a68..85ca0f2b7 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -352,10 +352,21 @@ export default { // If the Service Zip entered is serviceable then save the Zip Info and Email Address and navigate forward if (this.$store.getters.order.serviceLocation.zipCode != this.zip) { - await this.dispatchStoreAction(storeActions.SAVE_SERVICE_LOCATION, { - zipCode: this.zip, - state: zipValidationResponse.data.state - }, false); + const vehicleRegistrationInfo = this.$store.getters.vehicle.registration; + if (vehicleRegistrationInfo.zipCode == this.zip) { + await this.dispatchStoreAction(storeActions.SAVE_SERVICE_LOCATION, { + address: vehicleRegistrationInfo.address, + city: vehicleRegistrationInfo.city, + zipCode: vehicleRegistrationInfo.zipCode, + state: vehicleRegistrationInfo.state + }, false); + } + else { + await this.dispatchStoreAction(storeActions.SAVE_SERVICE_LOCATION, { + zipCode: this.zip, + state: zipValidationResponse.data.state + }, false); + } } await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.email, false);