Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d6614df

Browse files
committedAug 27, 2018
Code style corrections
1 parent 91781a9 commit d6614df

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed
 

‎.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ __coverage__
44
dist
55
node_modules
66
_auto_doc_
7-
.vscode
7+
.vscode
8+
topcoder-react-lib-*.*.*.tgz

‎src/actions/direct.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,15 @@ function getUserProjectsInit(tokenV3) {
7979
* @static
8080
* @desc Creates an action that loads projects related to a user.
8181
* @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.
8285
* @return {Action}
8386
*/
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);
8791
return { tokenV3, projects };
8892
}
8993

‎src/services/challenges.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,10 @@ class ChallengesService {
435435
* @param {String} description
436436
* @param {String} assignee
437437
* @param {Number} payment
438+
* @param {String} submissionGuidelines
439+
* @param {Number} copilotId
440+
* @param {Number} copilotFee
441+
* @param {?} technologies
438442
* @return {Promise} Resolves to the created challenge object (payment task).
439443
*/
440444
async createTask(
@@ -446,16 +450,9 @@ class ChallengesService {
446450
payment,
447451
submissionGuidelines,
448452
copilotId,
449-
copilotPaymentAmount,
453+
copilotFee,
450454
technologies,
451455
) {
452-
const copilotPayload = copilotId === 0
453-
? {}
454-
: {
455-
copilotId,
456-
copilotFee: copilotPaymentAmount,
457-
};
458-
459456
const payload = {
460457
param: {
461458
assignees: [assignee],
@@ -472,9 +469,14 @@ class ChallengesService {
472469
reviewType: 'INTERNAL',
473470
subTrack: 'FIRST_2_FINISH',
474471
task: true,
475-
...copilotPayload,
476472
},
477473
};
474+
if (copilotId) {
475+
_.assign(payload.param, {
476+
copilotId,
477+
copilotFee,
478+
});
479+
}
478480
let res = await this.private.api.postJson('/challenges', payload);
479481
if (!res.ok) throw new Error(res.statusText);
480482
res = (await res.json()).result;

0 commit comments

Comments
 (0)
Please sign in to comment.