diff options
author | Fatih Acet <acetfatih@gmail.com> | 2019-01-07 18:23:53 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2019-01-31 01:18:13 +0300 |
commit | f1acd5051513ee815578f7311ca88ee54e79e323 (patch) | |
tree | b878c2a49a4098926ecb620c6bc05ae36c862d2d /app/assets/javascripts/issue_show | |
parent | 45eabf921a9bb90677d1e4f59544f0a7abcbc879 (diff) |
Show error message from backend
Diffstat (limited to 'app/assets/javascripts/issue_show')
-rw-r--r-- | app/assets/javascripts/issue_show/components/app.vue | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/assets/javascripts/issue_show/components/app.vue b/app/assets/javascripts/issue_show/components/app.vue index b6eacf839b9..d65b44ca6f3 100644 --- a/app/assets/javascripts/issue_show/components/app.vue +++ b/app/assets/javascripts/issue_show/components/app.vue @@ -250,8 +250,14 @@ export default { if (error && error.name === 'SpamError') { this.openRecaptcha(); } else { + let errMsg = `Error updating ${this.issuableType}`; + + if (error && error.response && error.response.data && error.response.data.errors) { + errMsg = error.response.data.errors; + } + eventHub.$emit('close.form'); - window.Flash(`Error updating ${this.issuableType}`); + window.Flash(errMsg); } }); }, |