Commit 8d83e517 authored by Phil Hughes's avatar Phil Hughes

Converted task_list.js to use axios

parent c7b9bba5
import 'deckar01-task_list';
import axios from './lib/utils/axios_utils';
import Flash from './flash';
export default class TaskList {
......@@ -38,12 +39,9 @@ export default class TaskList {
patchData[this.dataType] = {
[this.fieldName]: $target.val(),
};
return $.ajax({
type: 'PATCH',
url: $target.data('update-url') || $('form.js-issuable-update').attr('action'),
data: patchData,
success: this.onSuccess,
error: this.onError,
});
return axios.patch($target.data('update-url') || $('form.js-issuable-update').attr('action'), patchData)
.then(({ data }) => this.onSuccess(data))
.catch(() => this.onError());
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment