CSR-726 Clear serviceLocation address and city on vin-lookup unless zip matches registration zip

This commit is contained in:
Katie 2022-07-13 10:53:19 -04:00
parent 086392c561
commit cc6ecd9918

View file

@ -352,11 +352,22 @@ export default {
// If the Service Zip entered is serviceable then save the Zip Info and Email Address and navigate forward // 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) { if (this.$store.getters.order.serviceLocation.zipCode != this.zip) {
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, { await this.dispatchStoreAction(storeActions.SAVE_SERVICE_LOCATION, {
zipCode: this.zip, zipCode: this.zip,
state: zipValidationResponse.data.state state: zipValidationResponse.data.state
}, false); }, false);
} }
}
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.email, false); await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.email, false);