diff options
Diffstat (limited to 'models/lists.js')
-rw-r--r-- | models/lists.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/models/lists.js b/models/lists.js index e6bbfa00..7ed27361 100644 --- a/models/lists.js +++ b/models/lists.js @@ -76,11 +76,14 @@ Lists.allow({ Lists.helpers({ cards(swimlaneId) { - return Cards.find(Filter.mongoSelector({ + const selector = { listId: this._id, archived: false, - swimlaneId: swimlaneId, - }), { sort: ['sort'] }); + }; + if (swimlaneId) + selector.swimlaneId = swimlaneId; + return Cards.find(Filter.mongoSelector(selector, + { sort: ['sort'] })); }, allCards() { |