1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-23 07:09:44 +02:00

Preserve members and labels when transfer card to another board

This commit is contained in:
Maksim Eltyshev 2020-05-09 05:30:52 +05:00
parent ca6efd5b71
commit 35f9631326
17 changed files with 321 additions and 64 deletions

View file

@ -76,7 +76,7 @@ module.exports = {
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
let { card, project } = cardToProjectPath;
const { list } = cardToProjectPath;
const { list, board } = cardToProjectPath;
let isUserMemberForProject = await sails.helpers.isUserMemberForProject(
project.id,
@ -88,6 +88,8 @@ module.exports = {
}
let toList;
let toBoard;
if (!_.isUndefined(inputs.listId) && inputs.listId !== list.id) {
toList = await List.findOne({
id: inputs.listId,
@ -98,7 +100,7 @@ module.exports = {
throw Errors.LIST_NOT_FOUND;
}
({ project } = await sails.helpers
({ board: toBoard, project } = await sails.helpers
.getListToProjectPath(toList.id)
.intercept('pathNotFound', () => Errors.LIST_NOT_FOUND));
@ -122,7 +124,16 @@ module.exports = {
'isSubscribed',
]);
card = await sails.helpers.updateCard(card, values, toList, list, currentUser, this.req);
card = await sails.helpers.updateCard(
card,
values,
toList,
toBoard,
list,
board,
currentUser,
this.req,
);
if (!card) {
throw Errors.CARD_NOT_FOUND;