Commit 7e0bfb6b authored by Marvin Karegyeya's avatar Marvin Karegyeya Committed by Kushal Pandya

Remove moveIssue logic from list model

parent 58ddbc5d
...@@ -138,12 +138,7 @@ class List { ...@@ -138,12 +138,7 @@ class List {
} }
moveIssue(issue, oldIndex, newIndex, moveBeforeId, moveAfterId) { moveIssue(issue, oldIndex, newIndex, moveBeforeId, moveAfterId) {
this.issues.splice(oldIndex, 1); boardsStore.moveListIssues(this, issue, oldIndex, newIndex, moveBeforeId, moveAfterId);
this.issues.splice(newIndex, 0, issue);
boardsStore.moveIssue(issue.id, null, null, moveBeforeId, moveAfterId).catch(() => {
// TODO: handle request error
});
} }
moveMultipleIssues({ issues, oldIndicies, newIndex, moveBeforeId, moveAfterId }) { moveMultipleIssues({ issues, oldIndicies, newIndex, moveBeforeId, moveAfterId }) {
......
...@@ -591,6 +591,15 @@ const boardsStore = { ...@@ -591,6 +591,15 @@ const boardsStore = {
}); });
}, },
moveListIssues(list, issue, oldIndex, newIndex, moveBeforeId, moveAfterId) {
list.issues.splice(oldIndex, 1);
list.issues.splice(newIndex, 0, issue);
this.moveIssue(issue.id, null, null, moveBeforeId, moveAfterId).catch(() => {
// TODO: handle request error
});
},
moveMultipleIssues({ ids, fromListId, toListId, moveBeforeId, moveAfterId }) { moveMultipleIssues({ ids, fromListId, toListId, moveBeforeId, moveAfterId }) {
return axios.put(this.generateMultiDragPath(this.state.endpoints.boardId), { return axios.put(this.generateMultiDragPath(this.state.endpoints.boardId), {
from_list_id: fromListId, from_list_id: fromListId,
......
---
title: Remove moveIssue logic from list model
merge_request: 32242
author: nuwe1
type: other
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