mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00
12 lines
396 B
JavaScript
12 lines
396 B
JavaScript
/**
|
|
* Increment the user's post count and upvote the post
|
|
*/
|
|
function afterPostSubmitOperations (post) {
|
|
var userId = post.userId,
|
|
postAuthor = Meteor.users.findOne(userId);
|
|
|
|
Meteor.users.update({_id: userId}, {$inc: {"telescope.postCount": 1}});
|
|
Telescope.upvoteItem(Posts, post, postAuthor);
|
|
return post;
|
|
}
|
|
Telescope.callbacks.add("postSubmitAsync", afterPostSubmitOperations);
|