Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
fix(default-theme): errors about displaying errors in NesletterForm (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jlsjonas authored Nov 16, 2020
1 parent 8bc8a71 commit 2f90777
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
/>
</div>

<SwErrorsList :list="errorMessage" />
<SwErrorsList :list="errorMessages" />

<SwButton class="send button">
{{ $t("send") }}
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -216,7 +216,7 @@ export default {
salutationsError,
getConfirmationText,
sendForm,
errorMessage,
errorMessages,
salutation,
firstName,
lastName,
Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
/>
</transition>

<SwErrorsList :list="errorMessage" />
<SwErrorsList :list="errorMessages" />

<span>
<SwButton
Expand Down Expand Up @@ -96,7 +96,7 @@ export default {
},
setup(props, { root }) {
const { apiInstance } = getApplicationContext(root, "SwFooter")
const errorMessage = ref("")
const errorMessages = ref([])
const email = ref(null)
const formSent = ref(false)
const sendForm = async () => {
Expand All @@ -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
Expand Down

1 comment on commit 2f90777

@vercel
Copy link

@vercel vercel bot commented on 2f90777 Nov 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.