Merge pull request #16759 from Bouncey/fix/filtrePrivateChallenges

fix(redirects): Do not add private blocks/challenges to the map
pull/16673/merge
Berkeley Martinez 2018-02-21 07:23:23 -08:00 committed by GitHub
commit cae5db6763
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -33,7 +33,8 @@ const getFirstChallenge = _.once(_getFirstChallenge);
*/
export function _cachedMap({ Block, Challenge }) {
const challenges = Challenge.find$({
order: [ 'order ASC', 'suborder ASC' ]
order: [ 'order ASC', 'suborder ASC' ],
where: { isPrivate: false }
});
const challengeMap = challenges
.map(
@ -44,7 +45,10 @@ export function _cachedMap({ Block, Challenge }) {
return hash;
}, {})
);
const blocks = Block.find$({ order: [ 'superOrder ASC', 'order ASC' ] });
const blocks = Block.find$({
order: [ 'superOrder ASC', 'order ASC' ],
where: { isPrivate: false }
});
const blockMap = Observable.combineLatest(
blocks.map(
blocks => blocks