From 69dc8f304cc0b8b35ed044de60e95730ab19f52b Mon Sep 17 00:00:00 2001 From: "John R. Supplee" Date: Fri, 2 Apr 2021 21:40:52 +0200 Subject: [PATCH] Only search label names in boards of type 'board' --- models/boards.js | 1 + models/cards.js | 1 + server/publications/cards.js | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/models/boards.js b/models/boards.js index 42b356daa..40435bfca 100644 --- a/models/boards.js +++ b/models/boards.js @@ -505,6 +505,7 @@ Boards.attachSchema( type: { /** * The type of board + * possible values: board, template-board, template-container */ type: String, defaultValue: 'board', diff --git a/models/cards.js b/models/cards.js index a0aed5c69..71f0e343d 100644 --- a/models/cards.js +++ b/models/cards.js @@ -299,6 +299,7 @@ Cards.attachSchema( type: { /** * type of the card + * possible values: cardType-card, cardType-linkedCard, cardType-linkedBoard */ type: String, defaultValue: 'cardType-card', diff --git a/server/publications/cards.js b/server/publications/cards.js index 1af29bdb0..c8c2497f7 100644 --- a/server/publications/cards.js +++ b/server/publications/cards.js @@ -294,7 +294,7 @@ function buildSelector(queryParams) { queryParams.getPredicates(OPERATOR_LABEL).forEach(label => { const queryLabels = []; - let boards = Boards.userSearch(userId, { + let boards = Boards.userBoards(userId, null, { labels: { $elemMatch: { color: label.toLowerCase() } }, }); @@ -318,7 +318,7 @@ function buildSelector(queryParams) { const reLabel = new RegExp(escapeForRegex(label), 'i'); // eslint-disable-next-line no-console // console.log('reLabel:', reLabel); - boards = Boards.userSearch(userId, { + boards = Boards.userBoards(userId, null, { labels: { $elemMatch: { name: reLabel } }, });