Merge pull request #604 from Safelite/defect/CSR-729-3

CSR-726 Clear serviceLocation address and city on vin-lookup unless z…
This commit is contained in:
katieoh-safelite 2022-07-13 11:32:11 -04:00 committed by GitHub
commit 2272cc91a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -302,23 +302,32 @@ export default {
if (zipValidationResponse.data.isServiceable) {
// 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.serviceZipCode) {
await this.dispatchStoreAction(storeActions.SAVE_SERVICE_LOCATION, {
zipCode: this.serviceZipCode,
state: zipValidationResponse.data.state
}, false);
const vehicleRegistrationInfo = this.$store.getters.vehicle.registration;
if (vehicleRegistrationInfo.zipCode == this.serviceZipCode) {
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.serviceZipCode,
state: zipValidationResponse.data.state
}, false);
}
}
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailAddress, false);
return await this.navigateForward();
}
// If the Service Zip is NOT serviceable then show an alert
this.displayNonServiceableZipAlert = true;
return this.$refs.funnelFooter.removeLoader();
},
async navigateForward(){
if (this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle) {