mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
Add ability to filter post views by category id
This commit is contained in:
parent
0983496203
commit
69eb51333c
1 changed files with 5 additions and 1 deletions
|
@ -38,7 +38,11 @@ Posts.getSubParams = function (terms) {
|
|||
if (!parameters.showFuture && !parameters.find.postedAt)
|
||||
parameters.find.postedAt = {$lte: new Date()};
|
||||
|
||||
// filter by category if category _id is provided
|
||||
if(!!terms.category)
|
||||
parameters.find.categories = {$in: [terms.category]};
|
||||
|
||||
// console.log(parameters);
|
||||
|
||||
return parameters;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue