We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 17f78c5 + 5a6bd19 commit ad79d52Copy full SHA for ad79d52
src/services/ChallengeService.js
@@ -29,7 +29,7 @@ async function filterChallengesByGroupsAccess (currentUser, challenges) {
29
const needToCheckForGroupAccess = !currentUser ? true : !currentUser.isMachine && !helper.hasAdminRole(currentUser)
30
console.log('needToCheckForGroupAccess', needToCheckForGroupAccess)
31
for (const challenge of challenges) {
32
- challenge.groups = _.filter(challenge.groups, g => _.toString(g).toLowerCase() !== 'null')
+ challenge.groups = _.filter(challenge.groups, g => !_.includes(['null', 'undefined'], _.toString(g).toLowerCase()))
33
console.log('challenge.groups', challenge.groups)
34
if (!challenge.groups || _.get(challenge, 'groups.length', 0) === 0 || !needToCheckForGroupAccess) {
35
res.push(challenge)
0 commit comments