summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/boards/stores/boards_store.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/boards/stores/boards_store.js')
-rw-r--r--app/assets/javascripts/boards/stores/boards_store.js25
1 files changed, 24 insertions, 1 deletions
diff --git a/app/assets/javascripts/boards/stores/boards_store.js b/app/assets/javascripts/boards/stores/boards_store.js
index 8b737d1dab0..df8b7a2df6c 100644
--- a/app/assets/javascripts/boards/stores/boards_store.js
+++ b/app/assets/javascripts/boards/stores/boards_store.js
@@ -1,4 +1,4 @@
-/* eslint-disable no-shadow */
+/* eslint-disable no-shadow, no-param-reassign */
/* global List */
import $ from 'jquery';
@@ -408,6 +408,29 @@ const boardsStore = {
return axios.delete(`${this.state.endpoints.listsEndpoint}/${id}`);
},
+ 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();
+ });
+ },
+
getIssuesForList(id, filter = {}) {
const data = { id };
Object.keys(filter).forEach(key => {