mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 06:25:50 +01:00
feat: send pids into filter:post.getFields hook
This commit is contained in:
@@ -21,7 +21,11 @@ module.exports = function (Posts) {
|
|||||||
} else {
|
} else {
|
||||||
postData = await db.getObjects(keys);
|
postData = await db.getObjects(keys);
|
||||||
}
|
}
|
||||||
const result = await plugins.fireHook('filter:post.getFields', { posts: postData, fields: fields });
|
const result = await plugins.fireHook('filter:post.getFields', {
|
||||||
|
pids: pids,
|
||||||
|
posts: postData,
|
||||||
|
fields: fields,
|
||||||
|
});
|
||||||
result.posts.forEach(post => modifyPost(post, fields));
|
result.posts.forEach(post => modifyPost(post, fields));
|
||||||
return Array.isArray(result.posts) ? result.posts : null;
|
return Array.isArray(result.posts) ? result.posts : null;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user