Skip to content

Commit 99d4352

Browse files
committed
Update of community stats calculation
A part of fix for topcoder-platform/community-app#1137
1 parent b1549ce commit 99d4352

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .",
3232
"test": "npm run lint && npm run jest"
3333
},
34-
"version": "0.4.3",
34+
"version": "0.4.4",
3535
"dependencies": {
3636
"auth0-js": "^6.8.4",
3737
"isomorphic-fetch": "^2.2.1",

src/actions/stats.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ async function getCommunityStatsDone(community, uuid, challenges, token) {
4747
const filterFunction = Filter.getFilterFunction(community.challengeFilter);
4848
filtered = filtered.filter(filterFunction);
4949
}
50-
const totalPrize = filtered.reduce(
51-
(total, challenge) => total + (challenge.totalPrize || 0),
52-
0,
50+
const totalPrize = Math.round(
51+
filtered.reduce(
52+
(total, challenge) => total + (challenge.totalPrize || 0),
53+
0,
54+
),
5355
);
5456
const groupService = getGroupService(token);
5557
const result = {

0 commit comments

Comments
 (0)