mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-07 14:31:58 +02:00
Merge branch 'master' into develop
This commit is contained in:
@@ -61,9 +61,9 @@ module.exports = function (Posts) {
|
||||
const tid = String(filter.tid);
|
||||
postData = postData.filter(item => item.data.tid && String(item.data.tid) === tid);
|
||||
} else if (Array.isArray(filter.tid)) {
|
||||
const tids = filter.tid.map(tid => parseInt(tid, 10));
|
||||
const tids = filter.tid.map(String);
|
||||
postData = postData.filter(
|
||||
item => item.data.tid && tids.includes(parseInt(item.data.tid, 10))
|
||||
item => item.data.tid && tids.includes(String(item.data.tid))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -200,9 +200,9 @@ module.exports = function (Posts) {
|
||||
}
|
||||
|
||||
async function updateTopicPosters(postData, toUid) {
|
||||
const postsByTopic = _.groupBy(postData, p => parseInt(p.tid, 10));
|
||||
const postsByTopic = _.groupBy(postData, p => String(p.tid));
|
||||
await async.eachOf(postsByTopic, async (posts, tid) => {
|
||||
const postsByUser = _.groupBy(posts, p => parseInt(p.uid, 10));
|
||||
const postsByUser = _.groupBy(posts, p => String(p.uid));
|
||||
await db.sortedSetIncrBy(`tid:${tid}:posters`, posts.length, toUid);
|
||||
await async.eachOf(postsByUser, async (posts, uid) => {
|
||||
await db.sortedSetIncrBy(`tid:${tid}:posters`, -posts.length, uid);
|
||||
|
||||
Reference in New Issue
Block a user