Added slotfiller property type to increase control over slot filling

This commit is contained in:
Stefan Zermatten
2020-10-15 14:54:58 +02:00
parent 8e9405b5ad
commit ed17d9e2d2
10 changed files with 214 additions and 16 deletions

View File

@@ -33,10 +33,17 @@ Meteor.publish('slotFillers', function(slotId){
// Build a filter for nodes in those libraries that match the slot
let filter = {
'ancestors.id': {$in: libraryIds},
'tags': {$all: slot.slotTags},
};
if (slot.tags.length){
filter.tags = {$all: slot.slotTags};
}
if (slot.slotType){
filter.type = slot.slotType;
filter.$or = [{
type: slot.slotType
},{
type: 'slotFiller',
slotFillerType: slot.slotType,
}];
}
return LibraryNodes.find(filter);
});