mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-04 21:15:55 +01:00
fix: controversial posts/bests posts not showing anything
fix upgrade script so posts with negative votes are stored, a post can have 10 upvotes and 2 downvotes fix missing negative votes checks remove unnecessary pids flters since the cids are only already filtered by topics:read
This commit is contained in:
@@ -57,8 +57,7 @@ const templateToData = {
|
||||
return cids.map(c => `cid:${c}:uid:${userData.uid}:pids:votes`);
|
||||
},
|
||||
getTopics: async (sets, req, start, stop) => {
|
||||
let pids = await db.getSortedSetRevRangeByScore(sets, start, stop, '+inf', '1');
|
||||
pids = await privileges.posts.filter('topics:read', pids, req.uid);
|
||||
const pids = await db.getSortedSetRevRangeByScore(sets, start, stop - start + 1, '+inf', 1);
|
||||
const postObjs = await posts.getPostSummaryByPids(pids, req.uid, { stripTags: false });
|
||||
return { posts: postObjs, nextStart: stop + 1 };
|
||||
},
|
||||
@@ -72,8 +71,7 @@ const templateToData = {
|
||||
return cids.map(c => `cid:${c}:uid:${userData.uid}:pids:votes`);
|
||||
},
|
||||
getTopics: async (sets, req, start, stop) => {
|
||||
let pids = await db.getSortedSetRangeByScore(sets, start, stop, '-inf', '-1');
|
||||
pids = await privileges.posts.filter('topics:read', pids, req.uid);
|
||||
const pids = await db.getSortedSetRangeByScore(sets, start, stop - start + 1, '-inf', -1);
|
||||
const postObjs = await posts.getPostSummaryByPids(pids, req.uid, { stripTags: false });
|
||||
return { posts: postObjs, nextStart: stop + 1 };
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user