mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 05:25:49 +01:00
fix: handle start=0 stop=0 for topics.getTopicPosts
add more tests
This commit is contained in:
@@ -39,7 +39,10 @@ module.exports = function (Topics) {
|
||||
repliesStart -= 1;
|
||||
}
|
||||
}
|
||||
const pids = await posts.getPidsFromSet(set, repliesStart, repliesStop, reverse);
|
||||
let pids = [];
|
||||
if (start !== 0 || stop !== 0) {
|
||||
pids = await posts.getPidsFromSet(set, repliesStart, repliesStop, reverse);
|
||||
}
|
||||
if (!pids.length && !topicOrTid.mainPid) {
|
||||
return [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user