diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index bfec46932..fe515e1fc 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -480,19 +480,6 @@ export default { async forwardButtonAction() { this.navigatingForward = true; - // clear items not needed for appointmentType - if (this.selectedAppointmentType == AppointmentTypeStrings.IN_SHOP) { - // if we have a provider.zipCodeCtu that's different than the servicelocation.zipCodeCtu then they - // may have selected a shop in a different ctu. change the servicelocation zip/ctu if different - if (this.zipCodeCtu != this.selectedProvider.address.zipCodeCtu) { - this.zipCodeCtu = this.selectedProvider.address.zipCodeCtu; - this.zipCode = this.selectedProvider.address.zipCode; - } - - this.city = null; - this.streetAddress = null; - } - if ( this.selectedAppointmentType == AppointmentTypeStrings.MOBILE && this.selectedProvider && @@ -505,6 +492,19 @@ export default { this.selectedProvider.address.zipCodeCtu = null; } + var ctu = this.zipCodeCtu; + if (this.selectedAppointmentType == AppointmentTypeStrings.IN_SHOP) { + // if we have a provider.zipCodeCtu that's different than the servicelocation.zipCodeCtu then they + // may have selected a shop in a different ctu. change the servicelocation zip/ctu if different + if (this.zipCodeCtu != this.selectedProvider.address.zipCodeCtu) { + ctu = this.selectedProvider.address.zipCodeCtu; + } + + this.city = null; + this.streetAddress = null; + } + + await this.dispatchStoreAction( this.storeActions.SAVE_SERVICE_LOCATION, { @@ -513,7 +513,7 @@ export default { city: this.city, state: this.state, zipCode: this.zipCode, - zipCodeCtu: this.zipCodeCtu, + zipCodeCtu: ctu, appointmentType: this.selectedAppointmentType, isVehicleProtected: this.isVehicleProtected, provider: { diff --git a/src/store/index.js b/src/store/index.js index 2be04b362..f023bd708 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -911,9 +911,10 @@ export const actions = { }, validateZip(context, { payload: { zip }, pageNameToLog }) { + const damageType = context.getters.damage.isRepair ? "Repair" : "Replace"; return globalMethods.callHttpClient({ methods: endpoints.ValidateZip.method, - endpoint: `${endpoints.ValidateZip.url}/${zip}`, + endpoint: `${endpoints.ValidateZip.url}/${zip}/${damageType}`, logApiCall: true, pageNameToLog: pageNameToLog, });