mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-08-13 05:47:49 +02:00
refactor: categories.sortTidsBySet to not take cid, retrieve from tids themselves
re: ##13255, this fixes the issue with topics outside of cid -1 in /world being sorted incorrectly
This commit is contained in:
@@ -52,7 +52,7 @@ controller.list = async function (req, res) {
|
||||
delete data.children;
|
||||
|
||||
let tids = await categories.getTopicIds(cidQuery);
|
||||
tids = await categories.sortTidsBySet(tids, -1, sort); // sorting not handled if cid is -1
|
||||
tids = await categories.sortTidsBySet(tids, sort); // sorting not handled if cid is -1
|
||||
data.topicCount = tids.length;
|
||||
data.topics = await topics.getTopicsByTids(tids, { uid: req.uid });
|
||||
topics.calculateTopicIndices(data.topics, start);
|
||||
|
||||
Reference in New Issue
Block a user