Skip to content

Feature gropups api #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
"lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .",
"test": "npm run lint && npm run jest"
},
"version": "0.7.11-9",
"version": "0.7.11-12",
"dependencies": {
"auth0-js": "^6.8.4",
"config": "^3.2.0",
7 changes: 1 addition & 6 deletions src/services/groups.js
Original file line number Diff line number Diff line change
@@ -131,19 +131,14 @@ export function checkUserGroups(groupIds, userGroups, knownGroups) {
return false;
}


/**
* Private. Handles given response from the groups API.
* @param {Object} response
* @return {Promise} On success resolves to the data fetched from the API.
*/
function handleApiResponse(response) {
if (!response.ok) throw new Error(response.statusText);
return response.json().then(({ result }) => {
// if (result.status !== 200) throw new Error(result.content);
return result;
});

return response.json().then(({ result }) => result);
}

/**
4 changes: 2 additions & 2 deletions src/utils/submission.js
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ function removeDecimal(num) {
}

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

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

if (_.isInteger(integerResult)) {
if (_.isInteger(result)) {
return integerResult;
}
return result;