I'm trying to publish data specific to the author of a document in my Jobs collection. My route is setup specifically to each unique author, which I then get via FlowRouter.getParam, but it still does not produce any data. I am subscribed to the 'refiJobs' publication but I'm still struggling. Thanks for reading - help is much appreciated!
My Publication
Meteor.publish('refiJobs', function () {
if (Roles.userIsInRole(this.userId, 'admin')) {
var author = FlowRouter.getParam('author');
return Jobs.find({author: author});
} else {
this.error(new Meteor.Error(403, "Access Denied"));
}
});
My route:
authenticatedRoutes.route( '/admin/:author', {
action: function() {
BlazeLayout.render( 'default', { yield: 'user' } );
}
});