mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 08:25:46 +01:00
feat: pass options to digest
This commit is contained in:
@@ -14,16 +14,21 @@ var utils = require('../utils');
|
||||
module.exports = function (Topics) {
|
||||
var stripTeaserTags = utils.stripTags.concat(['img']);
|
||||
|
||||
Topics.getTeasers = function (topics, uid, callback) {
|
||||
Topics.getTeasers = function (topics, options, callback) {
|
||||
if (!Array.isArray(topics) || !topics.length) {
|
||||
return callback(null, []);
|
||||
}
|
||||
let uid = options;
|
||||
let teaserPost = meta.config.teaserPost;
|
||||
if (typeof options === 'object') {
|
||||
uid = options.uid;
|
||||
teaserPost = options.teaserPost || meta.config.teaserPost;
|
||||
}
|
||||
|
||||
var counts = [];
|
||||
var teaserPids = [];
|
||||
var postData;
|
||||
var tidToPost = {};
|
||||
const teaserPost = this.teaserPost ? this.teaserPost : meta.config.teaserPost;
|
||||
|
||||
topics.forEach(function (topic) {
|
||||
counts.push(topic && topic.postcount);
|
||||
|
||||
Reference in New Issue
Block a user