mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 07:50:12 +01:00
Add searching of checklists
This commit is contained in:
parent
49df8f4b43
commit
5b51a36c62
1 changed files with 8 additions and 1 deletions
|
|
@ -507,7 +507,13 @@ Meteor.publish('globalSearch', function(sessionId, queryParams) {
|
||||||
|
|
||||||
if (queryParams.text) {
|
if (queryParams.text) {
|
||||||
const regex = new RegExp(escapeForRegex(queryParams.text), 'i');
|
const regex = new RegExp(escapeForRegex(queryParams.text), 'i');
|
||||||
|
const items = ChecklistItems.find({ title: regex });
|
||||||
|
const checklists = Checklists.find({
|
||||||
|
$or: [
|
||||||
|
{ title: regex },
|
||||||
|
{ _id: { $in: items.map(item => item.checklistId) } },
|
||||||
|
],
|
||||||
|
});
|
||||||
selector.$and.push({
|
selector.$and.push({
|
||||||
$or: [
|
$or: [
|
||||||
{ title: regex },
|
{ title: regex },
|
||||||
|
|
@ -520,6 +526,7 @@ Meteor.publish('globalSearch', function(sessionId, queryParams) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{ _id: { $in: checklists.map(list => list.cardId) } },
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue