From 2f907779c19b374a6aa87828a2b3a274d2153138 Mon Sep 17 00:00:00 2001 From: Jonas De Kegel Date: Mon, 16 Nov 2020 11:34:38 +0100 Subject: [PATCH] fix(default-theme): errors about displaying errors in NesletterForm (#1232) --- .../src/cms/elements/CmsElementContactForm.vue | 14 +++++++------- .../src/cms/elements/CmsElementNesletterForm.vue | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/default-theme/src/cms/elements/CmsElementContactForm.vue b/packages/default-theme/src/cms/elements/CmsElementContactForm.vue index aba785a3e..1f2bcb575 100644 --- a/packages/default-theme/src/cms/elements/CmsElementContactForm.vue +++ b/packages/default-theme/src/cms/elements/CmsElementContactForm.vue @@ -110,7 +110,7 @@ /> - + {{ $t("send") }} @@ -181,7 +181,7 @@ export default { "I have read and agree with the data protection regulations." ) - const errorMessage = ref("") + const errorMessages = ref([]) const salutation = ref(null) const firstName = ref(null) const lastName = ref(null) @@ -206,7 +206,7 @@ export default { ) formSent.value = true } catch (e) { - errorMessage.value = getMessagesFromErrorsArray(e.message) + errorMessages.value = getMessagesFromErrorsArray(e.message) } } const checkbox = ref(false) @@ -216,7 +216,7 @@ export default { salutationsError, getConfirmationText, sendForm, - errorMessage, + errorMessages, salutation, firstName, lastName, @@ -230,12 +230,12 @@ export default { }, methods: { async submit() { - this.errorMessage = "" + this.errorMessages = [] this.$v.$touch() if (this.$v.$invalid) { - this.errorMessage = this.$t( + this.errorMessages = [this.$t( "Please fill form data and check regulations acceptance." - ) + )] return } diff --git a/packages/default-theme/src/cms/elements/CmsElementNesletterForm.vue b/packages/default-theme/src/cms/elements/CmsElementNesletterForm.vue index 07ca51977..fe4eb8aed 100644 --- a/packages/default-theme/src/cms/elements/CmsElementNesletterForm.vue +++ b/packages/default-theme/src/cms/elements/CmsElementNesletterForm.vue @@ -48,7 +48,7 @@ /> - + { @@ -114,20 +114,20 @@ export default { ) formSent.value = true } catch (e) { - errorMessage.value = getMessagesFromErrorsArray(e.message) + errorMessages.value = getMessagesFromErrorsArray(e.message) } } return { email, sendForm, - errorMessage, + errorMessages, formSent, } }, methods: { async submit() { - this.errorMessage = "" + this.errorMessages = [] this.$v.$touch() if (this.$v.$invalid) { return