Added code to display invalid zip alert

This commit is contained in:
Leah Schumann 2023-02-17 09:35:10 -05:00
parent ba80ae58d2
commit 4562f7679e

View file

@ -36,7 +36,7 @@
ref="alertInvalidZip"
v-if="displayInvalidZipAlert"
class="my-4"
:cmsWidgetName="AlertInvalidZipWidget"
cmsWidgetName="AlertInvalidZipWidget"
alertClass="alert-danger"
v-bind:isDismissible="false" />
</modal>
@ -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: {