mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
posts/recent.js refactor
This commit is contained in:
@@ -24,13 +24,9 @@ module.exports = function(Posts) {
|
||||
return callback(null, []);
|
||||
}
|
||||
|
||||
var keys = pids.map(function(pid) {
|
||||
return 'post:' + pid;
|
||||
});
|
||||
|
||||
var fields = ['pid', 'tid', 'content', 'uid', 'timestamp', 'deleted'].concat(options.extraFields);
|
||||
|
||||
db.getObjectsFields(keys, fields, function(err, posts) {
|
||||
Posts.getPostsFields(pids, fields, function(err, posts) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user