@@ -57,7 +57,6 @@ export function normalizeChallengeDetails(challenge, filtered, user, username) {
57
57
numberOfCheckpointsPrizes : challenge . numberOfCheckpointsPrizes ,
58
58
topCheckPointPrize : challenge . topCheckPointPrize ,
59
59
submissionsViewable : challenge . submissionsViewable || 'false' ,
60
- reviewType : challenge . reviewType ,
61
60
allowStockArt : challenge . allowStockArt === 'true' ,
62
61
fileTypes : challenge . filetypes || [ ] ,
63
62
environment : challenge . environment ,
@@ -66,12 +65,7 @@ export function normalizeChallengeDetails(challenge, filtered, user, username) {
66
65
submissionLimit : Number ( challenge . submissionLimit ) || 0 ,
67
66
drPoints : challenge . digitalRunPoints ,
68
67
directUrl : challenge . directUrl ,
69
- tags : _ . union (
70
- challenge . technologies || [ ] ,
71
- challenge . technology || [ ] ,
72
- challenge . platforms || [ ] ,
73
- challenge . tags || [ ] ,
74
- ) ,
68
+ tags : challenge . tags || [ ] ,
75
69
prizes : challenge . prize || challenge . prizes || [ ] ,
76
70
events : _ . map ( challenge . event , e => ( {
77
71
eventName : e . eventShortDesc ,
@@ -191,8 +185,7 @@ export function normalizeChallenge(challenge, username) {
191
185
if ( ! challenge . totalPrize ) {
192
186
challenge . totalPrize = challenge . prizes . reduce ( ( sum , x ) => sum + x , 0 ) ;
193
187
}
194
- if ( ! challenge . technologies ) challenge . technologies = [ ] ;
195
- if ( ! challenge . platforms ) challenge . platforms = [ ] ;
188
+ if ( ! challenge . tags ) challenge . tags = [ ] ;
196
189
197
190
if ( challenge . subTrack === 'DEVELOP_MARATHON_MATCH' ) {
198
191
challenge . track = 'DATA_SCIENCE' ;
@@ -338,7 +331,12 @@ class ChallengesService {
338
331
* is rejected.
339
332
*/
340
333
async activate ( challengeId ) {
341
- let res = await this . private . api . post ( `/challenges/${ challengeId } /activate` ) ;
334
+ const params = {
335
+ status : 'Active' ,
336
+ } ;
337
+
338
+ let res = await this . private . apiV5 . patch ( `/challenge/${ challengeId } ` , params ) ;
339
+
342
340
if ( ! res . ok ) throw new Error ( res . statusText ) ;
343
341
res = ( await res . json ( ) ) . result ;
344
342
if ( res . status !== 200 ) throw new Error ( res . content ) ;
@@ -348,15 +346,14 @@ class ChallengesService {
348
346
/**
349
347
* Closes the specified challenge.
350
348
* @param {Number } challengeId
351
- * @param {Number } winnerId Optional. ID of the assignee to declare the
352
- * winner.
353
349
* @return {Promise } Resolves to null value in case of success; otherwise it
354
350
* is rejected.
355
351
*/
356
- async close ( challengeId , winnerId ) {
357
- let url = `/challenges/${ challengeId } /close` ;
358
- if ( winnerId ) url = `${ url } ?winnerId=${ winnerId } ` ;
359
- let res = await this . private . api . post ( url ) ;
352
+ async close ( challengeId ) {
353
+ const params = {
354
+ status : 'Completed' ,
355
+ } ;
356
+ let res = await this . private . apiV5 . patch ( `/challenges/${ challengeId } /close` , params ) ;
360
357
if ( ! res . ok ) throw new Error ( res . statusText ) ;
361
358
res = ( await res . json ( ) ) . result ;
362
359
if ( res . status !== 200 ) throw new Error ( res . content ) ;
@@ -374,7 +371,7 @@ class ChallengesService {
374
371
* @param {String } submissionGuidelines
375
372
* @param {Number } copilotId
376
373
* @param {Number } copilotFee
377
- * @param {? } technologies
374
+ * @param {? } tags
378
375
* @return {Promise } Resolves to the created challenge object (payment task).
379
376
*/
380
377
async createTask (
@@ -387,7 +384,7 @@ class ChallengesService {
387
384
submissionGuidelines ,
388
385
copilotId ,
389
386
copilotFee ,
390
- technologies ,
387
+ tags ,
391
388
) {
392
389
const payload = {
393
390
param : {
@@ -398,7 +395,7 @@ class ChallengesService {
398
395
submissionGuidelines,
399
396
milestoneId : 1 ,
400
397
name : title ,
401
- technologies ,
398
+ tags ,
402
399
prizes : payment ? [ payment ] : [ ] ,
403
400
projectId,
404
401
registrationStartsAt : moment ( ) . toISOString ( ) ,
@@ -466,11 +463,11 @@ class ChallengesService {
466
463
}
467
464
468
465
/**
469
- * Gets possible challenge subtracks .
466
+ * Gets possible challenge types .
470
467
* @return {Promise } Resolves to the array of subtrack names.
471
468
*/
472
- getChallengeSubtracks ( ) {
473
- return this . private . apiV5 . get ( '/challengetypes ' )
469
+ getChallengeTypes ( ) {
470
+ return this . private . apiV5 . get ( '/challenge-types ' )
474
471
. then ( res => ( res . ok ? res . json ( ) : new Error ( res . statusText ) ) )
475
472
. then ( res => (
476
473
res . message
0 commit comments