mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-30 19:30:04 +01:00
sort tags by score
This commit is contained in:
@@ -253,6 +253,9 @@ module.exports = function (Topics) {
|
||||
topicTags.forEach(function (tags, index) {
|
||||
if (Array.isArray(tags)) {
|
||||
topicTags[index] = tags.map(function (tag) { return tagData[tag]; });
|
||||
topicTags[index].sort(function (tag1, tag2) {
|
||||
return tag2.score - tag1.score;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user