Condensed publication of single character, included spells

This commit is contained in:
Thaum
2015-02-05 10:06:10 +00:00
parent 524b45b936
commit 84c91e8239
2 changed files with 10 additions and 22 deletions

View File

@@ -22,10 +22,6 @@ Router.map( function () {
waitOn: function(){
return [
Meteor.subscribe("singleCharacter", this.params._id, Meteor.userId()),
Meteor.subscribe("characterContainers", this.params._id, Meteor.userId()),
Meteor.subscribe("characterItems", this.params._id, Meteor.userId()),
Meteor.subscribe("characterFeatures", this.params._id, Meteor.userId()),
Meteor.subscribe("characterEffects", this.params._id, Meteor.userId()),
];
},
data: function() {

View File

@@ -1,20 +1,12 @@
Meteor.publish("singleCharacter", function(characterId, userId){
//TODO check if this characer can be viewed by this user
return Characters.find({_id: characterId});
});
Meteor.publish("characterContainers", function(characterId, userId){
return Containers.find({charId: characterId});
});
Meteor.publish("characterItems", function(characterId, userId){
return Items.find({charId: characterId});
});
Meteor.publish("characterFeatures", function(characterId, userId){
return Features.find({charId: characterId});
});
Meteor.publish("characterEffects", function(characterId, userId){
return Effects.find({charId: characterId});
});
return [
Characters.find({_id: characterId}),
Containers.find({charId: characterId}),
Items.find({charId: characterId}),
Features.find({charId: characterId}),
Effects.find({charId: characterId}),
Spells.find({charId: characterId}),
SpellLists.find({charID: characterId})
];
});