From b144d147a83826967a641e95e22f0c27f61f12f0 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Mon, 19 May 2025 14:51:20 +0530 Subject: [PATCH] CASH-712 Defect fixed --- .../mobile-location-modal-questions.vue | 5 +---- src/layouts/service-location/service-location.vue | 10 ++++------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue index 36efad975..bde24ed09 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue @@ -236,12 +236,12 @@ export default { }, async setMobileLocation() { this.resetAlerts(); + this.setMobileLocationInvalid(true); // Validate the Zip Code if ( this.internalModel.addressQuestions.zipCode === "" || this.internalModel.addressQuestions.zipCode.length !== 5 ) { - this.setMobileLocationInvalid(true); return; } const zipCodeData = await this.getZipCodeData( @@ -251,11 +251,9 @@ export default { if (!zipCodeData.isValid) { this.displayInvalidZipAlert = true; - this.setMobileLocationInvalid(true); return; } else if (zipCodeData.state != this.internalModel.addressQuestions.state) { this.displayMismatchStateAndZipAlert = true; - this.setMobileLocationInvalid(true); return; } else if ( this.internalModel.addressQuestions.zipCode !== @@ -295,7 +293,6 @@ export default { } // update the page level model this.$emit("setMobileLocation", this.internalModel); - this.setMobileLocationInvalid(false); }, toggleMobileLocation() { this.isMobileLocationOpened = !this.isMobileLocationOpened; diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 5eef66e21..76e42bad9 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -526,6 +526,7 @@ export default { } if (this.isServiceableMobile) { this.setMobileLocation(newValue); + this.setMobileLocationInValid(false); } else { await getZipCodeData(newZipCode).then((zipCodeData) => { this.serviceZipCodeQuestion = { @@ -754,13 +755,13 @@ export default { setMobileLocationInValid(isMobileLocationInValid) { this.isMobileAddressValid = !isMobileLocationInValid; }, - displayMobileAddressQuestion(openMobileLocation) { + displayMobileAddressQuestion() { var mobileLocationQuestionsRef = this.$refs.mobileLocationQuestions; var isMobileAddressComplete = mobileLocationQuestionsRef?.isMobileAddressComplete; if (isMobileAddressComplete?.()) { mobileLocationQuestionsRef.isMobileLocationOpened = false; } else { - mobileLocationQuestionsRef.isMobileLocationOpened = openMobileLocation; + mobileLocationQuestionsRef.isMobileLocationOpened = true; } }, getIsMobileLocationOpened() { @@ -777,10 +778,8 @@ export default { this.selectedProvider = new Provider( this.shopProviderData.mobileProviderNumber ); - this.displayMobileAddressQuestion(true); } else { this.selectedProvider = new Provider(); - this.displayMobileAddressQuestion(false); } }); } @@ -792,10 +791,9 @@ export default { this.selectedProvider = new Provider( this.shopProviderData.mobileProviderNumber ); - this.displayMobileAddressQuestion(true); + this.displayMobileAddressQuestion(); } else { this.selectedProvider = new Provider(); - this.displayMobileAddressQuestion(false); } }, },