Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 207d374

Browse files
thabofletcherykohata
authored and
ykohata
committed
I-131385 challenge_duration check
1 parent e49b9da commit 207d374

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

actions/reports.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ var clientChallengeCosts = function (api, connection, next) {
560560
delete cost.challengeStatusId;
561561
delete cost.challengeFeePercentage;
562562

563-
cost.challengeDuration = parseFloat(item.challenge_duration.toFixed(1));
563+
cost.challengeDuration = item.challenge_duration ? parseFloat(item.challenge_duration.toFixed(1)) : 0;
564564
cost.postinDate = helper.formatDate(cost.postingDate, 'YYYY-MM-DD');
565565
cost.completionDate = helper.formatDate(cost.completionDate, 'YYYY-MM-DD');
566566
cost.challengeTotalCost = cost.challengeMemberCost + cost.challengeFee;
@@ -649,8 +649,8 @@ exports.getClientActiveChallengeCosts = {
649649
api.dataAccess.executeQuery("get_client_active_challenge_costs", sqlParameters, dbConnectionMap, cb);
650650
}, function (results, cb) {
651651
costs = _.map(results, function (item) {
652-
var duration = parseFloat(item.challenge_duration.toFixed(1)),
653-
currentPhaseText = item.current_phase;
652+
var duration = item.challenge_duration ? parseFloat(item.challenge_duration.toFixed(1)) : 0;
653+
var currentPhaseText = item.current_phase;
654654
/* currentPhaseArray = [];
655655
656656
if (currentPhaseText) {

0 commit comments

Comments
 (0)