sort tags by score

This commit is contained in:
Barış Soner Uşaklı
2017-12-09 15:21:17 -05:00
parent 2455df438c
commit b9d4b02780

View File

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