Skip to content

Commit 47bd4e5

Browse files
authored
Merge pull request #86 from topcoder-platform/feature-gropups-api
Feature gropups api
2 parents 51ae2f2 + 804776b commit 47bd4e5

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

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.7.11-9",
34+
"version": "0.7.11-12",
3535
"dependencies": {
3636
"auth0-js": "^6.8.4",
3737
"config": "^3.2.0",

src/services/groups.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,19 +131,14 @@ export function checkUserGroups(groupIds, userGroups, knownGroups) {
131131
return false;
132132
}
133133

134-
135134
/**
136135
* Private. Handles given response from the groups API.
137136
* @param {Object} response
138137
* @return {Promise} On success resolves to the data fetched from the API.
139138
*/
140139
function handleApiResponse(response) {
141140
if (!response.ok) throw new Error(response.statusText);
142-
return response.json().then(({ result }) => {
143-
// if (result.status !== 200) throw new Error(result.content);
144-
return result;
145-
});
146-
141+
return response.json().then(({ result }) => result);
147142
}
148143

149144
/**

src/utils/submission.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function removeDecimal(num) {
1313
}
1414

1515
function toAcurateFixed(num, decimal) {
16-
const re = new RegExp(`^-?\\d+(?:.\\d{0,${(decimal - 1)}})?`);
16+
const re = new RegExp(`^-?\\d+(?:.\\d{0,${(decimal)}})?`);
1717
return num.toString().match(re)[0];
1818
}
1919

@@ -24,7 +24,7 @@ function toFixed(num, decimal) {
2424
const result = _.toFinite(toAcurateFixed(num, decimal));
2525
const integerResult = _.toFinite(removeDecimal(num));
2626

27-
if (_.isInteger(integerResult)) {
27+
if (_.isInteger(result)) {
2828
return integerResult;
2929
}
3030
return result;

0 commit comments

Comments
 (0)