Commit 2de8fab4 authored by nuwe1's avatar nuwe1

Remove store logic from boards models

parent 93f92848
...@@ -83,27 +83,7 @@ class List { ...@@ -83,27 +83,7 @@ class List {
} }
save() { save() {
const entity = this.label || this.assignee || this.milestone; return boardsStore.saveList(this);
let entityType = '';
if (this.label) {
entityType = 'label_id';
} else if (this.assignee) {
entityType = 'assignee_id';
} else if (IS_EE && this.milestone) {
entityType = 'milestone_id';
}
return boardsStore
.createList(entity.id, entityType)
.then(res => res.data)
.then(data => {
this.id = data.id;
this.type = data.list_type;
this.position = data.position;
this.label = data.label;
return this.getIssues();
});
} }
destroy() { destroy() {
......
...@@ -525,6 +525,29 @@ const boardsStore = { ...@@ -525,6 +525,29 @@ const boardsStore = {
clearMultiSelect() { clearMultiSelect() {
this.multiSelect.list = []; this.multiSelect.list = [];
}, },
saveList(list) {
const entity = list.label || list.assignee || list.milestone;
let entityType = '';
if (list.label) {
entityType = 'label_id';
} else if (list.assignee) {
entityType = 'assignee_id';
} else if (IS_EE && list.milestone) {
entityType = 'milestone_id';
}
return this.createList(entity.id, entityType)
.then(res => res.data)
.then(data => {
list.id = data.id;
list.type = data.list_type;
list.position = data.position;
list.label = data.label;
return list.getIssues();
});
},
}; };
BoardsStoreEE.initEESpecific(boardsStore); BoardsStoreEE.initEESpecific(boardsStore);
......
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