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

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
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

Lines changed: 5 additions & 3 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy