File tree Expand file tree Collapse file tree 3 files changed +20
-13
lines changed Expand file tree Collapse file tree 3 files changed +20
-13
lines changed Original file line number Diff line number Diff line change @@ -4,4 +4,5 @@ __coverage__
4
4
dist
5
5
node_modules
6
6
_auto_doc_
7
- .vscode
7
+ .vscode
8
+ topcoder-react-lib- * . * . * .tgz
Original file line number Diff line number Diff line change @@ -79,11 +79,15 @@ function getUserProjectsInit(tokenV3) {
79
79
* @static
80
80
* @desc Creates an action that loads projects related to a user.
81
81
* @param {String } tokenV3 Topcoder auth token v3.
82
+ * @param {Boolean } hasActiveBillingAccount Optional. Defaults to false.
83
+ * Whether only projects with active billing accounts should be included
84
+ * into the results.
82
85
* @return {Action }
83
86
*/
84
- async function getUserProjectsDone ( tokenV3 , billAc ) {
85
- const param = billAc ? { hasActiveBillingAccount : true } : { } ;
86
- const projects = await getService ( tokenV3 ) . getUserProjects ( { ...param } ) ;
87
+ async function getUserProjectsDone ( tokenV3 , hasActiveBillingAccount ) {
88
+ const params = { } ;
89
+ if ( hasActiveBillingAccount ) params . hasActiveBillingAccount = true ;
90
+ const projects = await getService ( tokenV3 ) . getUserProjects ( params ) ;
87
91
return { tokenV3, projects } ;
88
92
}
89
93
Original file line number Diff line number Diff line change @@ -435,6 +435,10 @@ class ChallengesService {
435
435
* @param {String } description
436
436
* @param {String } assignee
437
437
* @param {Number } payment
438
+ * @param {String } submissionGuidelines
439
+ * @param {Number } copilotId
440
+ * @param {Number } copilotFee
441
+ * @param {? } technologies
438
442
* @return {Promise } Resolves to the created challenge object (payment task).
439
443
*/
440
444
async createTask (
@@ -446,16 +450,9 @@ class ChallengesService {
446
450
payment ,
447
451
submissionGuidelines ,
448
452
copilotId ,
449
- copilotPaymentAmount ,
453
+ copilotFee ,
450
454
technologies ,
451
455
) {
452
- const copilotPayload = copilotId === 0
453
- ? { }
454
- : {
455
- copilotId,
456
- copilotFee : copilotPaymentAmount ,
457
- } ;
458
-
459
456
const payload = {
460
457
param : {
461
458
assignees : [ assignee ] ,
@@ -472,9 +469,14 @@ class ChallengesService {
472
469
reviewType : 'INTERNAL' ,
473
470
subTrack : 'FIRST_2_FINISH' ,
474
471
task : true ,
475
- ...copilotPayload ,
476
472
} ,
477
473
} ;
474
+ if ( copilotId ) {
475
+ _ . assign ( payload . param , {
476
+ copilotId,
477
+ copilotFee,
478
+ } ) ;
479
+ }
478
480
let res = await this . private . api . postJson ( '/challenges' , payload ) ;
479
481
if ( ! res . ok ) throw new Error ( res . statusText ) ;
480
482
res = ( await res . json ( ) ) . result ;
You can’t perform that action at this time.
0 commit comments