From 4562f7679eec2c10f28b4be97c7a06b954e809e4 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Fri, 17 Feb 2023 09:35:10 -0500 Subject: [PATCH] Added code to display invalid zip alert --- .../mobile-location-modal-questions.vue | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 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 31378fc95..dc2df2e9a 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 @@ -36,7 +36,7 @@ ref="alertInvalidZip" v-if="displayInvalidZipAlert" class="my-4" - :cmsWidgetName="AlertInvalidZipWidget" + cmsWidgetName="AlertInvalidZipWidget" alertClass="alert-danger" v-bind:isDismissible="false" /> @@ -57,6 +57,7 @@ export default { data() { return { internalModel: this.copyModel(this.modelValue), + displayInvalidZipAlert: false, }; }, props: { @@ -162,11 +163,17 @@ export default { async setMobileLocation() { // TODO: Any lookups or actions to be taken before assigning the Mobile Location + const zipCodeData = await this.getZipCodeData(this.internalModel.addressQuestions.zipCode); - // Update the page level model - this.$emit("update:modelValue", this.internalModel); + if (!zipCodeData.isValid) { + this.displayInvalidZipAlert = true; + } else { + // Update the page level model + this.$emit("update:modelValue", this.internalModel); + + this.closeModal(); + } - this.closeModal(); }, }, watch: {