mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 01:51:40 -05:00
fix comment publication bug
This commit is contained in:
parent
7e34caf0eb
commit
d78cb03b89
4 changed files with 8 additions and 3 deletions
1
.meteor/cordova-plugins
Normal file
1
.meteor/cordova-plugins
Normal file
|
@ -0,0 +1 @@
|
|||
|
|
@ -66,4 +66,3 @@ matb33:collection-hooks
|
|||
djedi:sanitize-html
|
||||
rajit:bootstrap3-datepicker
|
||||
telescope-update-prompt
|
||||
|
||||
|
|
|
@ -81,6 +81,7 @@ scheduleNextCampaign = function (isTest) {
|
|||
|
||||
Meteor.methods({
|
||||
testCampaign: function () {
|
||||
if(isAdminById(this.userId))
|
||||
scheduleNextCampaign(true);
|
||||
}
|
||||
});
|
|
@ -2,7 +2,11 @@
|
|||
|
||||
Meteor.publish('singleComment', function(commentId) {
|
||||
if(canViewById(this.userId)){
|
||||
return Comments.find(commentId);
|
||||
// publish both current comment and child comments
|
||||
var commentIds = [commentId];
|
||||
var childCommentIds = _.pluck(Comments.find({parentCommentId: commentId}, {fields: {_id: 1}}).fetch(), '_id');
|
||||
commentIds = commentIds.concat(childCommentIds);
|
||||
return Comments.find({_id: {$in: commentIds}});
|
||||
}
|
||||
return [];
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue