Converted issuable_bulk_update_actions to axios
This commit is contained in:
parent
ba96309fb8
commit
5792faf4ae
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue