mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-26 01:09:56 +01:00
Merge pull request #3308 from acardinale/master
Uniform action:post.* hook
This commit is contained in:
@@ -270,6 +270,9 @@ var async = require('async'),
|
||||
var isFavouriting = type === 'favourite';
|
||||
|
||||
async.parallel({
|
||||
owner: function(next) {
|
||||
posts.getPostField(pid, 'uid', next);
|
||||
},
|
||||
postData: function(next) {
|
||||
posts.getPostFields(pid, ['pid', 'uid'], next);
|
||||
},
|
||||
@@ -312,9 +315,13 @@ var async = require('async'),
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
var current = results.hasFavourited ? 'favourited' : 'unfavourited';
|
||||
|
||||
plugins.fireHook('action:post.' + type, {
|
||||
pid: pid,
|
||||
uid: uid,
|
||||
owner: results.owner,
|
||||
current: current
|
||||
});
|
||||
|
||||
callback(null, {
|
||||
|
||||
Reference in New Issue
Block a user