From bcd6f95e0c5b429146cc52d62558a7d3780fb23d Mon Sep 17 00:00:00 2001 From: Manuel Kasper Date: Tue, 13 Dec 2022 17:31:34 +0100 Subject: [PATCH] Show error message from SOTAwatch, if any --- src/components/EditAlert.vue | 6 +++++- src/components/EditSpot.vue | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/EditAlert.vue b/src/components/EditAlert.vue index 0ae884f..866de77 100644 --- a/src/components/EditAlert.vue +++ b/src/components/EditAlert.vue @@ -249,9 +249,13 @@ export default { this.$parent.close() }) .catch(err => { + let errorText = err.message + if (err.response && err.response.data) { + errorText = err.response.data + } this.$buefy.dialog.alert({ title: 'Error', - message: 'Could not post alert: ' + err.message, + message: 'Could not post alert: ' + errorText, type: 'is-danger', ariaRole: 'alertdialog', ariaModal: true diff --git a/src/components/EditSpot.vue b/src/components/EditSpot.vue index 8db9891..d34520b 100644 --- a/src/components/EditSpot.vue +++ b/src/components/EditSpot.vue @@ -219,9 +219,13 @@ export default { this.$parent.close() }) .catch(err => { + let errorText = err.message + if (err.response && err.response.data) { + errorText = err.response.data + } this.$buefy.dialog.alert({ title: 'Error', - message: 'Could not post spot: ' + err.message, + message: 'Could not post spot: ' + errorText, type: 'is-danger', ariaRole: 'alertdialog', ariaModal: true