Skip to content

Node.js based forum software built for the modern web

use getPostsFields

barisusaklief35b83806f1
diff --git a/src/posts/recent.js b/src/posts/recent.js
index 12dab097d4..f3a0508a79 100644
--- a/src/posts/recent.js
+++ b/src/posts/recent.js
@@ -43,15 +43,7 @@ module.exports = function(Posts) {
return callback(err);
}
- if (!Array.isArray(pids) || !pids.length) {
- return callback(null, []);
- }
-
- pids = pids.map(function(pid) {
- return 'post:' + pid;
- });
-
- db.getObjectsFields(pids, ['uid'], function(err, postData) {
+ Posts.getPostsFields(pids, ['uid'], function(err, postData) {
if (err) {
return callback(err);
}