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,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);