mirror of
https://github.com/plankanban/planka.git
synced 2025-12-17 01:11:23 +03:00
Remove members and labels when transfer card to another board
This commit is contained in:
@@ -80,12 +80,32 @@ module.exports = {
|
||||
|
||||
let card;
|
||||
if (!_.isEmpty(values)) {
|
||||
// FIXME: hack
|
||||
if (inputs.toList && inputs.toList.boardId !== inputs.list.boardId) {
|
||||
await CardSubscription.destroy({
|
||||
cardId: inputs.record.id,
|
||||
});
|
||||
|
||||
await CardMembership.destroy({
|
||||
cardId: inputs.record.id,
|
||||
});
|
||||
|
||||
await CardLabel.destroy({
|
||||
cardId: inputs.record.id,
|
||||
});
|
||||
}
|
||||
|
||||
card = await Card.updateOne(inputs.record.id).set(values);
|
||||
|
||||
if (!card) {
|
||||
return exits.success(card);
|
||||
}
|
||||
|
||||
// FIXME: hack
|
||||
if (inputs.toList && inputs.toList.boardId !== inputs.list.boardId) {
|
||||
card.isSubscribed = false;
|
||||
}
|
||||
|
||||
sails.sockets.broadcast(
|
||||
`board:${card.boardId}`,
|
||||
'cardUpdate',
|
||||
|
||||
Reference in New Issue
Block a user