Vulcan/packages/_nova-subscribe-to-posts/lib/server/publications.js
2016-02-23 16:59:15 +09:00

10 lines
276 B
JavaScript

Meteor.publish('userSubscribedPosts', function(terms) {
if (this.userId) {
terms.currentUserId = this.userId; // add userId to terms
}
var parameters = Posts.parameters.get(terms);
var posts = Posts.find(parameters.find, parameters.options);
return posts;
});