v1.18.x
barisusakli 8 years ago
parent 7a0db03d99
commit 974106b7e2

@ -94,13 +94,17 @@ var plugins = require('./plugins');
};
Posts.getPostData = function (pid, callback) {
db.getObject('post:' + pid, function (err, data) {
if (err) {
return callback(err);
async.waterfall([
function (next) {
db.getObject('post:' + pid, next);
},
function (data, next) {
plugins.fireHook('filter:post.getPostData', { post: data }, next);
},
function (data, next) {
next(null, data.post);
}
plugins.fireHook('filter:post.get', data, callback);
});
], callback);
};
Posts.getPostField = function (pid, field, callback) {

@ -101,7 +101,7 @@ module.exports = function (Posts) {
if (err) {
return next(err);
}
plugins.fireHook('filter:post.get', postData, next);
plugins.fireHook('filter:post.get', { post: postData, uid: data.uid }, next);
});
},
function (postData, next) {

Loading…
Cancel
Save