diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index 727bc03e4..0041e553c 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -106,15 +106,10 @@ p.providerNumber === newModel.selectedProviderNumber - ); - if (provider) { - this.selectedProvider = provider; - } - } - }, async getMoreScheduleData(startDate, endDate) { // called only when "View more dates" is clicked; not on initial page load const moreShopTimeSlots = await getScheduleApiResponse({ diff --git a/src/layouts/service-location/shop-question/shop-question-popup.vue b/src/layouts/service-location/shop-question/shop-question-popup.vue index cb2a2e337..d74744a20 100644 --- a/src/layouts/service-location/shop-question/shop-question-popup.vue +++ b/src/layouts/service-location/shop-question/shop-question-popup.vue @@ -25,7 +25,7 @@ ref="serviceZipQuestion" class="shop-question-zipcode" customInputId="serviceZipCode" - v-model="internalModel.zipCode" + v-model="newZipCode" cmsWidgetName="ServiceZipQuestionWidget" @search-icon-click="onSearchZip" @keydown.enter="onSearchZip" @@ -111,7 +111,7 @@ export default { mixins: [baseMixin], data() { return { - internalModel: this.copyModel(this.modelValue), // zip refactor + newZipCode: this.zipCode, answers: [], shopListButton: shopListButton, shopIndex: 0, @@ -125,13 +125,6 @@ export default { }, props: { shopProviderData: Object, - modelValue: { - type: Object, - default: () => ({ - state: "", - zipCode: "", - }), - }, zipCode: { type: String, default: "", @@ -157,12 +150,6 @@ export default { modal() { return this.$refs.shopQuestionModal; }, - selectedValue: { - get: function () { - return this.modelValue; - }, - set: function (newValue) {}, - }, additionalButtonData() { const startDate = new Date(); const endDate = new Date(); @@ -271,12 +258,6 @@ export default { this.scrollToPageBottom(); }, - copyModel(modelToCopy) { - return { - state: modelToCopy.state, - zipCode: modelToCopy.zipCode, - }; - }, onModalOpened() { const preSelectedIndex = this.shopProviders.findIndex( (provider) => provider.providerNumber == this.preSelectedProviderNumber @@ -287,8 +268,7 @@ export default { } else { this.shopIndex = 3; } - this.internalModel = this.copyModel(this.modelValue); - this.internalModel.zipCode = this.zipCode; + this.localShopProviderData = this.shopProviderData; this.answers = []; this.onSearchZip(); @@ -307,7 +287,6 @@ export default { this.modal.closeModal(); }, onModalClosed() { - this.internalModel = this.copyModel(this.modelValue); this.resetsOnZipInput(); }, resetsOnZipInput() { @@ -320,9 +299,8 @@ export default { } this.resetsOnZipInput(); this.displayNoShopsAlert = false; - const zip = this.internalModel.zipCode; const zipCodeData = await this.getZipCodeData( - this.internalModel.zipCode, + this.newZipCode, "service-location" ); if (!zipCodeData.isValid) { @@ -333,7 +311,7 @@ export default { if (this.isVehicleHeavyTruck) { // check the location endpoint to verify this zip can service a heavy truck const closestShops = await getClosestApplicableShops( - this.internalModel.zipCode, + this.newZipCode, this.carId, "service-location" ); @@ -344,12 +322,12 @@ export default { return null; } } else { - getShopProviderData(zip).then(async (result) => { + getShopProviderData(this.newZipCode).then(async (result) => { if (this.displayNoShopsAlert === true) { this.displayNoShopsAlert = false; } this.localShopProviderData = result.data; - this.updateShopsForZip(this.internalModel.zipCode); + this.updateShopsForZip(this.newZipCode); this.selectedProvider = new Provider(); }); } @@ -504,15 +482,12 @@ export default { this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase); this.$emit("updated-bill-to-account-number", billToAccountNumber); this.$emit("updated-zipcode-ctu", selectedProvider.address.zipCodeCtu); - - this.$emit("update:modelValue", this.selectedValue); this.$emit("update-shop-provider-data", this.localShopProviderData); - this.internalModel.state = zipCodeData.state; this.$emit("shop-selected", { providerNumber: selectedProvider?.providerNumber, address: selectedProvider?.address, searchedZip: zipToEmit, - searchedState: this.internalModel.state, + searchedState: zipCodeData.state, }); this.closeModal();