Skip to content

Commit 3199619

Browse files
authored
Merge pull request #42 from topcoder-platform/issues-188
Issues-178 with permissisons
2 parents c37e43a + d30e06e commit 3199619

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

src/services/vanilla.js

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -104,23 +104,9 @@ async function manageVanillaUser (data) {
104104
userID: vanillaUser.userID
105105
})
106106
logger.info(`The user '${vanillaUser.name}' was added to the group '${group.name}'`)
107-
// if User is added => watch the category
108-
for (const category of categories) {
109-
await vanillaClient.watchCategory(category.categoryID, vanillaUser.userID, { watched: true })
110-
logger.info(`The user ${vanillaUser.name} watches categoryID=${category.categoryID} associated with challenge ${challengeId}`)
111-
await vanillaClient.followCategory(category.categoryID, { followed: true, userID: vanillaUser.userID })
112-
logger.info(`The user ${vanillaUser.name} follows categoryID=${category.categoryID} associated with challenge ${challengeId}`)
113-
}
114107
break
115108
}
116109
case constants.USER_ACTIONS.KICK: {
117-
// if User is removed => don't watch the category
118-
for (const category of categories) {
119-
await vanillaClient.watchCategory(category.categoryID, vanillaUser.userID, { watched: false })
120-
logger.info(`The user ${vanillaUser.name} stopped watching categoryID=${category.categoryID} associated with challenge ${challengeId}`)
121-
await vanillaClient.followCategory(category.categoryID, { followed: false, userID: vanillaUser.userID })
122-
logger.info(`The user ${vanillaUser.name} unfollows categoryID=${category.categoryID} associated with challenge ${challengeId}`)
123-
}
124110
await vanillaClient.removeUserFromGroup(group.groupID, vanillaUser.userID)
125111
logger.info(`The user '${vanillaUser.name}' was removed from the group '${group.name}'`)
126112
break
@@ -247,7 +233,8 @@ async function createVanillaGroup (challenge) {
247233
name: challenge.name,
248234
urlcode: `${challenge.id}`,
249235
parentCategoryID: parentCategory[0].categoryID,
250-
displayAs: groupTemplate.categories ? constants.VANILLA.CATEGORY_DISPLAY_STYLE.CATEGORIES : constants.VANILLA.CATEGORY_DISPLAY_STYLE.DISCUSSIONS
236+
displayAs: groupTemplate.categories ? constants.VANILLA.CATEGORY_DISPLAY_STYLE.CATEGORIES : constants.VANILLA.CATEGORY_DISPLAY_STYLE.DISCUSSIONS,
237+
groupID: group.groupID
251238
})
252239

253240
logger.info(`The '${challengeCategory.name}' category was created`)
@@ -258,7 +245,8 @@ async function createVanillaGroup (challenge) {
258245
const { body: childCategory } = await vanillaClient.createCategory({
259246
name: item.name,
260247
urlcode: `${urlCodeTemplate({ challenge })}`,
261-
parentCategoryID: challengeCategory.categoryID
248+
parentCategoryID: challengeCategory.categoryID,
249+
groupID: group.groupID
262250
})
263251
logger.info(`The '${item.name}' category was created`)
264252
await createDiscussions(group, challenge, item.discussions, childCategory)

0 commit comments

Comments
 (0)