mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
14
src/posts.js
14
src/posts.js
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user