diff options
author | Phil Hughes <me@iamphill.com> | 2018-01-29 12:32:04 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-01-29 12:32:04 +0000 |
commit | 5792faf4ae45b3380478bf9abaf9993c711354b3 (patch) | |
tree | bd2df5e24b269a8960602cb5740c31709aa5a193 | |
parent | ba96309fb895bf590adec66f6445b3f34da3310b (diff) | |
download | gitlab-ce-5792faf4ae45b3380478bf9abaf9993c711354b3.tar.gz |
Converted issuable_bulk_update_actions to axios
-rw-r--r-- | app/assets/javascripts/issuable_bulk_update_actions.js | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/app/assets/javascripts/issuable_bulk_update_actions.js b/app/assets/javascripts/issuable_bulk_update_actions.js index b124fafec70..8c1b2e78ca4 100644 --- a/app/assets/javascripts/issuable_bulk_update_actions.js +++ b/app/assets/javascripts/issuable_bulk_update_actions.js @@ -1,5 +1,6 @@ /* eslint-disable comma-dangle, quotes, consistent-return, func-names, array-callback-return, space-before-function-paren, prefer-arrow-callback, max-len, no-unused-expressions, no-sequences, no-underscore-dangle, no-unused-vars, no-param-reassign */ import _ from 'underscore'; +import axios from './lib/utils/axios_utils'; import Flash from './flash'; export default { @@ -22,15 +23,9 @@ export default { }, submit() { - const _this = this; - const xhr = $.ajax({ - url: this.form.attr('action'), - method: this.form.attr('method'), - dataType: 'JSON', - data: this.getFormDataAsObject() - }); - xhr.done(() => window.location.reload()); - xhr.fail(() => this.onFormSubmitFailure()); + axios[this.form.attr('method')](this.form.attr('action'), this.getFormDataAsObject()) + .then(() => window.location.reload()) + .catch(() => this.onFormSubmitFailure()); }, onFormSubmitFailure() { |