X-Git-Url: https://git.r.bdr.sh/rbdr/crowdantine/blobdiff_plain/6c43b90f4ac8ae47cd26076db44e912891673e77..b60a2ad4b9dd04aaa5830c53235b094b0d5281ca:/index.html?ds=inline diff --git a/index.html b/index.html index 077a8e0..c8f19c2 100644 --- a/index.html +++ b/index.html @@ -22,7 +22,7 @@ var request = new XMLHttpRequest(); request.addEventListener('load', renderEvents); - request.open('GET', 'https://api.rollbar.com/api/1/items/?access_token=' + kReadToken + '&environment=production&status=active'); + request.open('GET', 'https://api.rollbar.com/api/1/items/?access_token=' + kReadToken + '&environment=production&status=active&level=error'); request.send(); }; @@ -32,7 +32,7 @@ var generateProposalHTML = function(proposal) { var listItem = document.createElement('li'); - listItem.innerHTML = proposal.title + ' (' + proposal.total_occurrences + ' votes) I agree. ' + listItem.innerHTML = proposal.title + ' (' + proposal.total_occurrences + ' votes) I agree. ' return listItem; }; @@ -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)); }); @@ -127,12 +129,12 @@
Vote on the recommendations, or add one.
-