mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 13:20:41 +01:00
refactor: shorter code for pinned topics
This commit is contained in:
@@ -24,12 +24,8 @@ module.exports = function (Categories) {
|
||||
};
|
||||
|
||||
Categories.getTopicIds = async function (data) {
|
||||
const dataForPinned = { ...data };
|
||||
dataForPinned.start = 0;
|
||||
dataForPinned.stop = -1;
|
||||
|
||||
const [pinnedTids, set, direction] = await Promise.all([
|
||||
Categories.getPinnedTids(dataForPinned),
|
||||
Categories.getPinnedTids({ ...data, start: 0, stop: -1 }),
|
||||
Categories.buildTopicsSortedSet(data),
|
||||
Categories.getSortedSetRangeDirection(data.sort),
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user