Skip to content

Commit 4623f70

Browse files
authored
Merge pull request #39 from topcoder-platform/issues-99
Issues-123: Added members with 'customer' role
2 parents aef09ed + ad00562 commit 4623f70

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/constants.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ module.exports = {
4040
KICK: 'kick'
4141
},
4242
TOPCODER: {
43-
ROLE_COPILOT: 'copilot',
44-
ROLE_MANAGER: 'manager'
43+
PROJECT_ROLES: {
44+
COPILOT: 'copilot',
45+
MANAGER: 'manager',
46+
CUSTOMER: 'customer'
47+
}
4548
},
4649
VANILLA: {
4750
CHALLENGES_FORUM: 'Challenges Forums',

src/services/vanilla.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,9 @@ async function createVanillaGroup (challenge) {
181181
}
182182

183183
const { body: project } = await topcoderApi.getProject(challenge.projectId)
184+
const allProjectRoles = _.values(constants.TOPCODER.PROJECT_ROLES)
184185
const members = _.filter(project.members, member => {
185-
return member.role === constants.TOPCODER.ROLE_COPILOT || member.role === constants.TOPCODER.ROLE_MANAGER
186+
return _.includes(allProjectRoles, member.role)
186187
})
187188

188189
const challengesForums = _.filter(template.categories, ['name', constants.VANILLA.CHALLENGES_FORUM])

0 commit comments

Comments
 (0)