mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
models: cards: an empty string in members or label deletes the list
There is currently no way to remove all members or all labels attached to a card. If an empty string is provided, we can consider as a hint to remove the list from the card.
This commit is contained in:
parent
2ce1ba37a1
commit
e5949504b7
1 changed files with 12 additions and 2 deletions
|
@ -1459,7 +1459,12 @@ if (Meteor.isServer) {
|
|||
if (req.body.hasOwnProperty('labelIds')) {
|
||||
let newlabelIds = req.body.labelIds;
|
||||
if (_.isString(newlabelIds)) {
|
||||
newlabelIds = [newlabelIds];
|
||||
if (newlabelIds === '') {
|
||||
newlabelIds = null;
|
||||
}
|
||||
else {
|
||||
newlabelIds = [newlabelIds];
|
||||
}
|
||||
}
|
||||
Cards.direct.update({
|
||||
_id: paramCardId,
|
||||
|
@ -1520,7 +1525,12 @@ if (Meteor.isServer) {
|
|||
if (req.body.hasOwnProperty('members')) {
|
||||
let newmembers = req.body.members;
|
||||
if (_.isString(newmembers)) {
|
||||
newmembers = [newmembers];
|
||||
if (newmembers === '') {
|
||||
newmembers = null;
|
||||
}
|
||||
else {
|
||||
newmembers = [newmembers];
|
||||
}
|
||||
}
|
||||
Cards.direct.update({_id: paramCardId, listId: paramListId, boardId: paramBoardId, archived: false},
|
||||
{$set: {members: newmembers}});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue