Commit 2d3b2b7c authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Extract and use current board state on JS

parent e7642dd9
...@@ -42,6 +42,7 @@ export default { ...@@ -42,6 +42,7 @@ export default {
this.error = false; this.error = false;
const board = Store.state.currentBoard;
const labels = this.list.label ? [this.list.label] : []; const labels = this.list.label ? [this.list.label] : [];
const issue = new ListIssue({ const issue = new ListIssue({
title: this.title, title: this.title,
...@@ -51,9 +52,7 @@ export default { ...@@ -51,9 +52,7 @@ export default {
project_id: this.selectedProject.id, project_id: this.selectedProject.id,
}); });
if (Store.state.currentBoard) { if (board) {
const board = Store.state.currentBoard;
issue.assignees = [board.assignee]; issue.assignees = [board.assignee];
issue.labels = _.sortBy(_.uniq([...labels, ...board.labels], label => label.id), issue.labels = _.sortBy(_.uniq([...labels, ...board.labels], label => label.id),
'title'); 'title');
......
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