mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 09:06:15 +01:00
feat: remove sort again
This commit is contained in:
@@ -290,15 +290,13 @@ module.exports = function (Topics) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Topics.getTopicTags = async function (tid) {
|
Topics.getTopicTags = async function (tid) {
|
||||||
const tags = await db.getSetMembers(`topic:${tid}:tags`);
|
return await db.getSetMembers(`topic:${tid}:tags`);
|
||||||
return tags.sort();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Topics.getTopicsTags = async function (tids) {
|
Topics.getTopicsTags = async function (tids) {
|
||||||
const keys = tids.map(tid => `topic:${tid}:tags`);
|
return await db.getSetsMembers(
|
||||||
const tags = await db.getSetsMembers(keys);
|
tids.map(tid => `topic:${tid}:tags`)
|
||||||
tags.forEach(tags => tags.sort());
|
);
|
||||||
return tags;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Topics.getTopicTagsObjects = async function (tid) {
|
Topics.getTopicTagsObjects = async function (tid) {
|
||||||
@@ -317,7 +315,6 @@ module.exports = function (Topics) {
|
|||||||
topicTags.forEach((tags, index) => {
|
topicTags.forEach((tags, index) => {
|
||||||
if (Array.isArray(tags)) {
|
if (Array.isArray(tags)) {
|
||||||
topicTags[index] = tags.map(tag => tagDataMap[tag]);
|
topicTags[index] = tags.map(tag => tagDataMap[tag]);
|
||||||
topicTags[index].sort((tag1, tag2) => tag2.value - tag1.value);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user