sort tags by score

v1.18.x
Barış Soner Uşaklı 7 years ago
parent 2455df438c
commit b9d4b02780

@ -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;
});
}
});

Loading…
Cancel
Save