refactor: prolly dont need exists check

This commit is contained in:
Barış Soner Uşaklı
2024-11-20 17:15:51 -05:00
parent 93bb73c17e
commit a42c9a6bec

View File

@@ -281,8 +281,7 @@ module.exports = function (Topics) {
Topics.getTopicField(tid, 'mainPid'),
db.getSortedSetRange(`tid:${tid}:posts`, 0, -1),
]);
const mainPidExists = await posts.exists(mainPid);
if (mainPidExists) {
if (mainPid) {
pids = [mainPid].concat(pids);
}
return pids;