@@ -163,12 +163,6 @@ async function createVanillaGroup (challenge) {
163
163
throw new Error ( 'Multiple discussions with type=\'challenge\' and provider=\'vanilla\' are not supported.' )
164
164
}
165
165
166
- const isSelfService = challenge . legacy . selfService && challenge . legacy . selfService === true ? true : false
167
- if ( isSelfService && challenge . status !== constants . TOPCODER . CHALLENGE_STATUSES . ACTIVE ) {
168
- logger . info ( `The forums are created only for self-service challenges with the Active status.` )
169
- return
170
- }
171
-
172
166
const { body : project } = await topcoderApi . getProject ( challenge . projectId )
173
167
const allProjectRoles = _ . values ( constants . TOPCODER . PROJECT_ROLES )
174
168
const members = _ . filter ( project . members , member => {
@@ -249,7 +243,7 @@ async function createVanillaGroup (challenge) {
249
243
logger . info ( `The '${ challengeCategory . name } ' category was created.` )
250
244
251
245
if ( groupTemplate . categories ) {
252
- const categories = _ . filter ( groupTemplate . categories , [ 'selfService' , isSelfService ] )
246
+ const categories = groupTemplate . categories
253
247
for ( const item of categories ) {
254
248
const urlCodeTemplate = _ . template ( item . urlcode )
255
249
const { body : childCategory } = await vanillaClient . createCategory ( {
@@ -265,7 +259,7 @@ async function createVanillaGroup (challenge) {
265
259
}
266
260
267
261
if ( groupTemplate . discussions ) {
268
- const groupDiscussions = _ . filter ( groupTemplate . discussions , [ 'selfService' , isSelfService ] )
262
+ const groupDiscussions = groupTemplate . discussions
269
263
await createDiscussions ( group , challenge , groupDiscussions , challengeCategory )
270
264
}
271
265
@@ -296,9 +290,8 @@ async function updateVanillaGroup (challenge) {
296
290
297
291
const { body : groups } = await vanillaClient . searchGroups ( challenge . id )
298
292
if ( groups . length === 0 ) {
299
- const isSelfService = challenge . legacy . selfService && challenge . legacy . selfService === true ? true : false
300
- // Create the forums for self-service challenges with the Active status
301
- if ( isSelfService && challenge . status === constants . TOPCODER . CHALLENGE_STATUSES . ACTIVE ) {
293
+ // Create the forums for all challenges with the Active status
294
+ if ( challenge . status === constants . TOPCODER . CHALLENGE_STATUSES . ACTIVE ) {
302
295
await createVanillaGroup ( challenge )
303
296
return
304
297
} else {
0 commit comments