]> git.r.bdr.sh - rbdr/crowdantine/commitdiff
Sort by votes
authorBen Beltran <redacted>
Mon, 6 Apr 2020 22:08:49 +0000 (00:08 +0200)
committerBen Beltran <redacted>
Mon, 6 Apr 2020 22:08:49 +0000 (00:08 +0200)
index.html

index bc3f8b6e8f6c185d2a2ed6ebb8f35e06d9926244..d839fe2213d9c474f599098df2cd80b21664cea0 100644 (file)
@@ -45,7 +45,9 @@
 
         const container = document.getElementById('proposals');
 
-        parsedResponse.result.items.forEach((proposal) => {
+        parsedResponse.result.items
+          .sort((a, b) => b.total_occurrences - a.total_occurrences)
+          .forEach((proposal) => {
 
           container.appendChild(generateProposalHTML(proposal));
         });