Merge branch 'master' into develop

This commit is contained in:
Barış Soner Uşaklı
2025-02-06 19:23:57 -05:00
9 changed files with 25 additions and 25 deletions

View File

@@ -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))
);
}

View File

@@ -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);