From 9b529572f60a380aa98ff26576d289e52fe0d664 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Thu, 19 Oct 2023 07:09:00 -0400 Subject: [PATCH] Fix for defect where the shop list wasn't updating correctly on zip change --- .../service-location/service-location.vue | 25 +++++++++++++------ .../shop-question/shop-question.vue | 2 ++ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index d1e818130..3e544eda6 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -441,7 +441,7 @@ export default { // If it already exists, update the price with latest data if (mobileFeeIndex >= 0) { supportingItems[mobileFeeIndex].laborAmount = this.mobileFeePart.laborAmount; - supportingItems[mobileFeeIndex].sellingPrice = this.mobileFeePart.sellingPrice; + supportingItems[mobileFeeIndex].selingPrice = this.mobileFeePart.selingPrice; supportingItems[mobileFeeIndex].kitPrice = this.mobileFeePart.kitPrice; } else { supportingItems.push(this.mobileFeePart); @@ -502,15 +502,26 @@ export default { }, }, watch: { - selectedAppointmentType: { - async handler(newValue) { - if (newValue === "Mobile") { - getShopProviderData(this.zipCode).then(async (result) => { - this.shopProviderData = result.data; + zipCode: { + handler(newValue) { + getShopProviderData(this.zipCode).then(async (result) => { + this.shopProviderData = result.data; + if (this.selectedAppointmentType === "Mobile") { this.selectedProvider = new Provider( this.shopProviderData.mobileProviderNumber ); - }); + } else { + this.selectedProvider = new Provider(); + } + }); + } + }, + selectedAppointmentType: { + handler(newValue) { + if (newValue === "Mobile") { + this.selectedProvider = new Provider( + this.shopProviderData.mobileProviderNumber + ); } else { this.selectedProvider = new Provider(); } diff --git a/src/layouts/service-location/shop-question/shop-question.vue b/src/layouts/service-location/shop-question/shop-question.vue index fa00ab1dc..57702f841 100644 --- a/src/layouts/service-location/shop-question/shop-question.vue +++ b/src/layouts/service-location/shop-question/shop-question.vue @@ -214,6 +214,8 @@ export default { }, shopProviders: { async handler(newValue) { + this.resetAnswers(); + await nextTick(); const selectedShopIndex = this.getSelectedProviderIndex( newValue,