mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-11 01:52:55 +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) {
|
Categories.getTopicIds = async function (data) {
|
||||||
const dataForPinned = { ...data };
|
|
||||||
dataForPinned.start = 0;
|
|
||||||
dataForPinned.stop = -1;
|
|
||||||
|
|
||||||
const [pinnedTids, set, direction] = await Promise.all([
|
const [pinnedTids, set, direction] = await Promise.all([
|
||||||
Categories.getPinnedTids(dataForPinned),
|
Categories.getPinnedTids({ ...data, start: 0, stop: -1 }),
|
||||||
Categories.buildTopicsSortedSet(data),
|
Categories.buildTopicsSortedSet(data),
|
||||||
Categories.getSortedSetRangeDirection(data.sort),
|
Categories.getSortedSetRangeDirection(data.sort),
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user