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

Commit 7b01f79

Browse files
committed
defaulting aggregate score to 0 if not present.
if it's a legit 0 value then it throws an error with the previous if statement. chucking that.
1 parent ceba184 commit 7b01f79

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/services/LeaderboardService.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,10 @@ async function updateLeaderboard (challengeId, memberId, review) {
215215

216216
if (review.resource === 'reviewSummation') {
217217
console.log('Updating leaderboard using review summation')
218-
if (!review.aggregateScore) {
219-
throw Error('Aggregate score is needed for the review summation')
220-
}
218+
221219
_.assignIn(existRecords[0], {
222220
finalDetails: {
223-
aggregateScore: review.aggregateScore,
221+
aggregateScore: review.aggregateScore?review.aggregateScore:0,
224222
testsPassed,
225223
totalTestCases
226224
}

0 commit comments

Comments
 (0)