summaryrefslogtreecommitdiffstats
path: root/models/boards.js
diff options
context:
space:
mode:
authorPedro Sousa <18445484+slvrpdr@users.noreply.github.com>2020-04-03 16:23:48 +0100
committerPedro Sousa <18445484+slvrpdr@users.noreply.github.com>2020-04-03 16:23:48 +0100
commit6e86292b997d40e36822efd10d6940e93da4abd0 (patch)
tree5f105f8284418e7e579d13a331212d2fd17ce189 /models/boards.js
parent1e0b53eb9bcfa6a2833ee2f268f480ca7d9838d7 (diff)
downloadwekan-6e86292b997d40e36822efd10d6940e93da4abd0.tar.gz
wekan-6e86292b997d40e36822efd10d6940e93da4abd0.tar.bz2
wekan-6e86292b997d40e36822efd10d6940e93da4abd0.zip
Search also a Card's Custom Fields
Diffstat (limited to 'models/boards.js')
-rw-r--r--models/boards.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/models/boards.js b/models/boards.js
index 8862f301..35ee1a36 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -806,7 +806,11 @@ Boards.helpers({
if (term) {
const regex = new RegExp(term, 'i');
- query.$or = [{ title: regex }, { description: regex }];
+ query.$or = [
+ { title: regex },
+ { description: regex },
+ { customFields: { $elemMatch: { value: regex } } },
+ ];
}
return Cards.find(query, projection);