mirror of
https://github.com/vale981/Vulcan
synced 2025-03-12 21:36:38 -04:00
15 lines
No EOL
573 B
JavaScript
15 lines
No EOL
573 B
JavaScript
import Users from 'meteor/vulcan:users';
|
|
import { addCallback } from 'meteor/vulcan:core';
|
|
import { Comments } from '../../../modules/comments/index.js';
|
|
|
|
import { performVoteServer } from 'meteor/vulcan:voting';
|
|
|
|
/**
|
|
* @summary Make users upvote their own new comments
|
|
*/
|
|
function CommentsNewUpvoteOwnComment(comment) {
|
|
var commentAuthor = Users.findOne(comment.userId);
|
|
return {...comment, ...performVoteServer({ document: comment, voteType: 'upvote', collection: Comments, user: commentAuthor })};
|
|
}
|
|
|
|
addCallback('comments.new.async', CommentsNewUpvoteOwnComment); |