Fix data coming down to error handler of tasklist

This commit is contained in:
Fatih Acet 2019-01-11 01:07:09 +01:00
parent 83306d249e
commit 1362267d45
No known key found for this signature in database
GPG Key ID: E994FE39E29B7E11
2 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,6 @@
<script>
import $ from 'jquery';
import createFlash from '~/flash';
import animateMixin from '../mixins/animate';
import TaskList from '../../task_list';
import recaptchaModalImplementor from '../../vue_shared/mixins/recaptcha_modal_implementor';
@ -89,7 +90,7 @@ export default {
},
taskListUpdateError(data) {
// stub for error handling
createFlash(data.errors[0]);
},
updateTaskStatusText() {

View File

@ -44,12 +44,12 @@ export default class TaskList {
const patchData = {};
patchData[this.dataType] = {
[this.fieldName]: $target.val(),
['lock_version']: this.lockVersion,
lock_version: this.lockVersion,
};
return axios
.patch($target.data('updateUrl') || $('form.js-issuable-update').attr('action'), patchData)
.then(({ data }) => this.onSuccess(data))
.catch(err => this.onError(err));
.catch(({ response }) => this.onError(response.data));
}
}