Handle tasklist update failed in app component

This commit is contained in:
Fatih Acet 2019-01-16 01:35:57 +01:00
parent b72f52f123
commit 7ad76a5418
No known key found for this signature in database
GPG key ID: E994FE39E29B7E11
2 changed files with 13 additions and 2 deletions

View file

@ -213,6 +213,14 @@ export default {
return undefined;
},
updateStoreState() {
this.service.getData()
.then(res => res.data)
.then(data => {
this.store.updateState(data);
});
},
openForm() {
if (!this.showForm) {
this.showForm = true;
@ -327,6 +335,7 @@ export default {
:issuable-type="issuableType"
:update-url="updateEndpoint"
:lock-version="state.lock_version"
@taskListUpdateFailed="updateStoreState"
/>
<edited-component
v-if="hasUpdated"

View file

@ -89,8 +89,10 @@ export default {
}
},
taskListUpdateError(data) {
createFlash(data.errors[0]);
taskListUpdateError({ errors, data }) {
createFlash('Someone edited this issue at the same time you did and we updated the issue description.');
this.$emit('taskListUpdateFailed');
},
updateTaskStatusText() {