Browse Source

Only search label names in boards of type 'board'

John R. Supplee 4 years ago
parent
commit
69dc8f304c
3 changed files with 4 additions and 2 deletions
  1. 1 0
      models/boards.js
  2. 1 0
      models/cards.js
  3. 2 2
      server/publications/cards.js

+ 1 - 0
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',

+ 1 - 0
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',

+ 2 - 2
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 } },
           });