diff options
author | Phil Hughes <me@iamphill.com> | 2018-02-02 14:54:18 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-02-05 09:41:46 +0000 |
commit | 39fa83553c6a05ebc08adc2eff8f8d25d9cdd8ac (patch) | |
tree | 9d8ba359a1ed6039002a5cb3bf2330121b1a2047 /app/assets/javascripts | |
parent | 10cc5d1a8069a3347b1139ea46c38a373b2b3a35 (diff) | |
download | gitlab-ce-39fa83553c6a05ebc08adc2eff8f8d25d9cdd8ac.tar.gz |
fixed unhandled promise rejection
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/right_sidebar.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/right_sidebar.js b/app/assets/javascripts/right_sidebar.js index 36658516228..01c3be5411f 100644 --- a/app/assets/javascripts/right_sidebar.js +++ b/app/assets/javascripts/right_sidebar.js @@ -75,12 +75,12 @@ Sidebar.prototype.toggleTodo = function(e) { $('.js-issuable-todo').disable().addClass('is-loading'); - return axios[ajaxType](url, { + axios[ajaxType](url, { issuable_id: $this.data('issuable-id'), issuable_type: $this.data('issuable-type'), }).then(({ data }) => { this.todoUpdateDone(data); - }); + }).catch(() => flash(`There was an error ${ajaxType === 'post' ? 'adding a' : 'deleting the'} todo.`)); }; Sidebar.prototype.todoUpdateDone = function(data) { |