closes #6523, closes #6524

This commit is contained in:
Barış Soner Uşaklı
2018-05-26 12:49:29 -04:00
parent 65dc530df5
commit 229e49cf8f
7 changed files with 93 additions and 41 deletions

View File

@@ -109,6 +109,20 @@ Posts.getPostData = function (pid, callback) {
], callback);
};
Posts.getPostsData = function (pids, callback) {
async.waterfall([
function (next) {
db.getObjects(pids.map(pid => 'post:' + pid), next);
},
function (data, next) {
plugins.fireHook('filter:post.getPostsData', { posts: data }, next);
},
function (data, next) {
next(null, data.posts);
},
], callback);
};
Posts.getPostField = function (pid, field, callback) {
async.waterfall([
function (next) {