remove hikes from map

closes #1682
This commit is contained in:
Berkeley Martinez
2015-08-12 20:39:40 -07:00
parent cd9dcc6953
commit 7eaccffd15

View File

@ -77,7 +77,11 @@ module.exports = function(app) {
name: blockArray[0].block, name: blockArray[0].block,
dashedName: dasherize(blockArray[0].block), dashedName: dasherize(blockArray[0].block),
challenges: blockArray challenges: blockArray
})); }))
.filter(({ name })=> {
return name !== 'Hikes';
})
.shareReplay();
const User = app.models.User; const User = app.models.User;
const userCount$ = observeMethod(User, 'count'); const userCount$ = observeMethod(User, 'count');
@ -135,6 +139,7 @@ module.exports = function(app) {
const challengeId = req.user.currentChallenge.challengeId; const challengeId = req.user.currentChallenge.challengeId;
// find challenge // find challenge
return challenge$ return challenge$
.filter(({ block }) => block !== 'Hikes')
.filter(({ id }) => id === challengeId) .filter(({ id }) => id === challengeId)
// now lets find the block it belongs to // now lets find the block it belongs to
.flatMap(challenge => { .flatMap(challenge => {
@ -537,6 +542,7 @@ module.exports = function(app) {
completed: completedCount / blockArray.length * 100 completed: completedCount / blockArray.length * 100
}; };
}) })
.filter(({ name }) => name !== 'Hikes')
// turn stream of blocks into a stream of an array // turn stream of blocks into a stream of an array
.toArray(); .toArray();