Commit 59300f29 authored by Marvin Karegyeya's avatar Marvin Karegyeya Committed by Kushal Pandya

Remove destroy function logic from list model

parent 36845e07
...@@ -83,13 +83,7 @@ class List { ...@@ -83,13 +83,7 @@ class List {
} }
destroy() { destroy() {
const index = boardsStore.state.lists.indexOf(this); boardsStore.destroy(this);
boardsStore.state.lists.splice(index, 1);
boardsStore.updateNewListDropdown(this.id);
boardsStore.destroyList(this.id).catch(() => {
// TODO: handle request error
});
} }
update() { update() {
......
...@@ -519,6 +519,15 @@ const boardsStore = { ...@@ -519,6 +519,15 @@ const boardsStore = {
destroyList(id) { destroyList(id) {
return axios.delete(`${this.state.endpoints.listsEndpoint}/${id}`); return axios.delete(`${this.state.endpoints.listsEndpoint}/${id}`);
}, },
destroy(list) {
const index = this.state.lists.indexOf(list);
this.state.lists.splice(index, 1);
this.updateNewListDropdown(list.id);
this.destroyList(list.id).catch(() => {
// TODO: handle request error
});
},
saveList(list) { saveList(list) {
const entity = list.label || list.assignee || list.milestone; const entity = list.label || list.assignee || list.milestone;
......
---
title: Remove destroy function logic from list model
merge_request: 32237
author: nuwe1
type: other
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