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({
type: Object,
required: true,
},
issueUpdate: {
type: String,
required: true,
},
},
computed: {
updateUrl() {
return this.issueUpdate.replace(':project_path', this.issue.project.path);
},
},
methods: {
removeIssue() {
......@@ -25,15 +34,16 @@ gl.issueBoards.RemoveIssueBtn = Vue.extend({
const lists = issue.getLists();
const labelIds = lists.map(list => list.label.id);
const data = {
remove_label_ids: labelIds,
issue: {
remove_label_ids: labelIds,
},
};
if (Store.state.currentBoard.milestone_id) {
data.milestone_id = -1;
data.issue.milestone_id = -1;
}
// 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');
lists.forEach((list) => {
......
......@@ -19,7 +19,6 @@ class ListIssue {
this.selected = false;
this.position = obj.relative_position || Infinity;
this.milestone_id = obj.milestone_id;
this.updateUrl = obj.update_url;
this.project_id = obj.project_id;
if (obj.project) {
......
......@@ -23,5 +23,6 @@
= render "shared/boards/components/sidebar/labels"
= render "shared/boards/components/sidebar/notifications"
%remove-btn{ ":issue" => "issue",
":issue-update" => "'#{build_issue_link_base}/' + issue.iid + '.json'",
":list" => "list",
"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