41 lines
820 B
JavaScript
41 lines
820 B
JavaScript
const standardLibraryIds = [
|
|
"SRDLibraryGA3XWsd",
|
|
];
|
|
|
|
Meteor.publish("standardLibraries", function(){
|
|
return Libraries.find({_id: {$in: standardLibraryIds}});
|
|
});
|
|
|
|
Meteor.publish("standardLibraryItems", function(categoryKey){
|
|
return LibraryItems.find({
|
|
library: {$in: standardLibraryIds},
|
|
"settings.category": categoryKey,
|
|
}, {
|
|
sort: {name: 1},
|
|
});
|
|
});
|
|
|
|
Meteor.publish("standardLibrarySpells", function(level){
|
|
return LibrarySpells.find({
|
|
library: {$in: standardLibraryIds},
|
|
level,
|
|
}, {
|
|
sort: {name: 1},
|
|
});
|
|
});
|
|
|
|
Meteor.publish("customLibraries", function(){
|
|
userId = this.userId;
|
|
return Libraries.find({
|
|
$or: [
|
|
{readers: userId},
|
|
{writers: userId},
|
|
{owner: userId},
|
|
],
|
|
});
|
|
});
|
|
|
|
Meteor.publish("libraryItems", function(libraryId){
|
|
return LibraryItems.find({library: libraryId});
|
|
});
|