Commit 5e0b2941 authored by Phil Hughes's avatar Phil Hughes

Removed if around board deleting

removed duplication
parent 9a425c3f
...@@ -40,12 +40,10 @@ class List { ...@@ -40,12 +40,10 @@ class List {
} }
destroy () { destroy () {
if (this.type !== 'blank') { gl.issueBoards.BoardsStore.state.lists.$remove(this);
gl.issueBoards.BoardsStore.state.lists.$remove(this); gl.issueBoards.BoardsStore.updateNewListDropdown(this.id);
gl.issueBoards.BoardsStore.updateNewListDropdown(this.id);
gl.boardService.destroyList(this.id); gl.boardService.destroyList(this.id);
}
} }
update () { update () {
...@@ -93,16 +91,20 @@ class List { ...@@ -93,16 +91,20 @@ class List {
createIssues (data) { createIssues (data) {
data.forEach((issueObj) => { data.forEach((issueObj) => {
this.issues.push(new ListIssue(issueObj)); this.addIssue(new ListIssue(issueObj));
}); });
} }
addIssue (issue, listFrom) { addIssue (issue, listFrom) {
this.issues.push(issue); this.issues.push(issue);
issue.addLabel(this.label); if (this.label) {
issue.addLabel(this.label);
}
gl.boardService.moveIssue(issue.id, listFrom.id, this.id); if (listFrom) {
gl.boardService.moveIssue(issue.id, listFrom.id, this.id);
}
} }
findIssue (id) { findIssue (id) {
......
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