Make sure projects are always available

This commit is contained in:
Berkeley Martinez
2016-02-10 17:28:45 -08:00
parent c2915f9e14
commit d8ad4a59eb

View File

@ -111,7 +111,12 @@ function buildDisplayChallenges(challengeMap = {}, timezone) {
[getChallengeGroup(challenges[0])]: challenges [getChallengeGroup(challenges[0])]: challenges
})); }));
}) })
.reduce((output, group) => ({ ...output, ...group}), {}); .reduce((output, group) => ({ ...output, ...group}), {})
.map(groups => ({
algorithms: groups.algorithms || [],
projects: groups.projects || [],
challenges: groups.challenges || []
}));
} }
module.exports = function(app) { module.exports = function(app) {