Files
DiceCloud/rpg-docs/server/publications/characterList.js
Stefan Zermatten 44a1daf6f8 Grouping characters by party now works
closes #75, finally
2017-07-14 17:09:30 +02:00

28 lines
449 B
JavaScript

Meteor.publish("characterList", function(){
var userId = this.userId;
if (!userId) {
this.ready();
return;
}
return [
Characters.find(
{$or: [{readers: userId}, {writers: userId}, {owner: userId}]},
{
fields: {
name: 1,
urlName: 1,
race: 1,
alignment: 1,
gender: 1,
readers: 1,
writers:1,
owner: 1,
color: 1,
picture: 1,
}
}
),
Parties.find({owner: userId}),
];
});