From 2bcc3108e42322194d70014509bd1138af3473d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Tue, 1 Oct 2019 10:38:27 +0200 Subject: [PATCH] Fix js errors --- .../ep_theme/Resources/Private/Assets/js/myep/Address.vue | 6 ++++-- .../Resources/Private/Assets/js/myep/Newsletter.vue | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/Address.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/Address.vue index efd98f1d..6d5a4fa1 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/Address.vue +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/Address.vue @@ -175,8 +175,10 @@ class: 'alert-danger' }); const violations = error.response.data.violations; - for (let violation of violations) { - this.formErrors[violation.property_path] = violation.message; + if (typeof violations !== 'undefined') { + for (let violation of violations) { + this.formErrors[violation.property_path] = violation.message; + } } }); } diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/Newsletter.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/Newsletter.vue index 791975f2..34dcb854 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/Newsletter.vue +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/Newsletter.vue @@ -20,7 +20,7 @@ export default { methods: { - ...mapMutations(['beginLoding', 'endLoading', 'alert']), + ...mapMutations(['beginLoading', 'endLoading', 'alert']), toggleReqistration () { this.userData.newsletter = !this.userData.newsletter; @@ -30,7 +30,7 @@ registration: this.userData.newsletter }; - this.beginLoding(); + this.beginLoading(); const client = axios.create({ headers: {