From a768563cd0c8775e67eea69793f3127fd99b8d7d Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 3 Nov 2021 14:45:15 +0100 Subject: [PATCH] location: display the error message in case of wrong phone number or email --- .../components/Location/NewLocation.vue | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location/NewLocation.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location/NewLocation.vue index 1b563d2a2..2920e15b2 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location/NewLocation.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location/NewLocation.vue @@ -244,13 +244,20 @@ export default { } }); } - postLocation(body).then(location => new Promise(resolve => { - console.log('postLocation', location); - this.locations.push(location); - this.$store.dispatch('updateLocation', location); - resolve(); - this.modal.showModal = false; - })); + postLocation(body) + .then( + location => new Promise(resolve => { + console.log('postLocation', location); + this.locations.push(location); + this.$store.dispatch('updateLocation', location); + resolve(); + this.modal.showModal = false; + }) + ).catch( + err => { + this.errors.push(err.message); + } + ); }; }, submitNewAddress(payload) {