We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1058e08 commit 5a6bd19Copy full SHA for 5a6bd19
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