Commit 3c21ea11 authored by Simon Knox's avatar Simon Knox

don't update bulk update path for Remove from board

parent 472604be
...@@ -18,6 +18,15 @@ gl.issueBoards.RemoveIssueBtn = Vue.extend({ ...@@ -18,6 +18,15 @@ gl.issueBoards.RemoveIssueBtn = Vue.extend({
type: Object, type: Object,
required: true, required: true,
}, },
issueUpdate: {
type: String,
required: true,
},
},
computed: {
updateUrl() {
return this.issueUpdate.replace(':project_path', this.issue.project.path);
},
}, },
methods: { methods: {
removeIssue() { removeIssue() {
...@@ -25,15 +34,16 @@ gl.issueBoards.RemoveIssueBtn = Vue.extend({ ...@@ -25,15 +34,16 @@ gl.issueBoards.RemoveIssueBtn = Vue.extend({
const lists = issue.getLists(); const lists = issue.getLists();
const labelIds = lists.map(list => list.label.id); const labelIds = lists.map(list => list.label.id);
const data = { const data = {
issue: {
remove_label_ids: labelIds, remove_label_ids: labelIds,
},
}; };
if (Store.state.currentBoard.milestone_id) { if (Store.state.currentBoard.milestone_id) {
data.milestone_id = -1; data.issue.milestone_id = -1;
} }
// Post the remove data // Post the remove data
gl.boardService.bulkUpdate([issue.id], data).catch(() => { Vue.http.patch(this.updateUrl, data).catch(() => {
new Flash('Failed to remove issue from board, please try again.', 'alert'); new Flash('Failed to remove issue from board, please try again.', 'alert');
lists.forEach((list) => { lists.forEach((list) => {
......
...@@ -19,7 +19,6 @@ class ListIssue { ...@@ -19,7 +19,6 @@ class ListIssue {
this.selected = false; this.selected = false;
this.position = obj.relative_position || Infinity; this.position = obj.relative_position || Infinity;
this.milestone_id = obj.milestone_id; this.milestone_id = obj.milestone_id;
this.updateUrl = obj.update_url;
this.project_id = obj.project_id; this.project_id = obj.project_id;
if (obj.project) { if (obj.project) {
......
...@@ -23,5 +23,6 @@ ...@@ -23,5 +23,6 @@
= render "shared/boards/components/sidebar/labels" = render "shared/boards/components/sidebar/labels"
= render "shared/boards/components/sidebar/notifications" = render "shared/boards/components/sidebar/notifications"
%remove-btn{ ":issue" => "issue", %remove-btn{ ":issue" => "issue",
":issue-update" => "'#{build_issue_link_base}/' + issue.iid + '.json'",
":list" => "list", ":list" => "list",
"v-if" => "canRemove" } "v-if" => "canRemove" }
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