From d7843ec8f03cf0818921cb582e8a0e7678a4695f Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Thu, 4 Jan 2024 16:08:37 -0500 Subject: [PATCH] CSR-1886 set mobile ctu --- .../service-location/service-location.vue | 28 +++++++++---------- src/store/index.js | 3 +- 2 files changed, 16 insertions(+), 15 deletions(-) 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, });