Skip to content

Commit

Permalink
feat: add replies to getPostSummaryByPids
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Aug 27, 2020
1 parent e0c7d65 commit a9dfc9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/posts/data.js
Expand Up @@ -7,6 +7,7 @@ const utils = require('../utils');
const intFields = [
'uid', 'pid', 'tid', 'deleted', 'timestamp',
'upvotes', 'downvotes', 'deleterUid', 'edited',
'replies',
];

module.exports = function (Posts) {
Expand Down
2 changes: 1 addition & 1 deletion src/posts/summary.js
Expand Up @@ -20,7 +20,7 @@ module.exports = function (Posts) {
options.parse = options.hasOwnProperty('parse') ? options.parse : true;
options.extraFields = options.hasOwnProperty('extraFields') ? options.extraFields : [];

const fields = ['pid', 'tid', 'content', 'uid', 'timestamp', 'deleted', 'upvotes', 'downvotes'].concat(options.extraFields);
const fields = ['pid', 'tid', 'content', 'uid', 'timestamp', 'deleted', 'upvotes', 'downvotes', 'replies'].concat(options.extraFields);

let posts = await Posts.getPostsFields(pids, fields);
posts = posts.filter(Boolean);
Expand Down

0 comments on commit a9dfc9a

Please sign in to comment.