From f97350ecf376b5396035d032c9840496b85069a2 Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Tue, 27 Jan 2015 03:29:17 -0500 Subject: [PATCH] Fixed challenge ordering --- controllers/resources.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/controllers/resources.js b/controllers/resources.js index 61becf46a5e..aefafe02c01 100644 --- a/controllers/resources.js +++ b/controllers/resources.js @@ -192,6 +192,15 @@ module.exports = { allBonfireIds: function() { return bonfires.map(function(elem) { + return { + _id: elem._id, + difficulty: elem.difficulty + } + }) + .sort(function(a, b) { + return a.difficulty - b.difficulty; + }) + .map(function(elem) { return elem._id; }) }