Skip to content

Feature stats history release #149

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 11 commits into from
Apr 1, 2020
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__coverage__
.build-info
.sass-cache
#dist
dist
node_modules
_auto_doc_
.vscode
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .",
"test": "npm run lint && npm run jest"
},
"version": "0.13.0",
"version": "0.14.0",
"dependencies": {
"auth0-js": "^6.8.4",
"config": "^3.2.0",
Expand Down
4 changes: 2 additions & 2 deletions src/actions/members.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ async function getStatsHistoryInit(handle, uuid) {
* @param {String} tokenV3 v3 auth token.
* @return {Action}
*/
async function getStatsHistoryDone(handle, uuid, tokenV3) {
const data = await getService(tokenV3).getStatsHistory(handle);
async function getStatsHistoryDone(handle, groupIds, uuid, tokenV3) {
const data = await getService(tokenV3).getStatsHistory(handle, groupIds);
return { data, handle, uuid };
}

Expand Down
9 changes: 7 additions & 2 deletions src/services/members.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,13 @@ class MembersService {
* @param {String} handle
* @return {Promise} Resolves to the stats object.
*/
async getStatsHistory(handle) {
const res = await this.private.api.get(`/members/${handle}/stats/history`);
async getStatsHistory(handle, groupIds) {
let res;
if (groupIds) {
res = await this.private.api.get(`/members/${handle}/stats/history?groupIds=${groupIds}`);
} else {
res = await this.private.api.get(`/members/${handle}/stats/history`);
}
return getApiResponsePayload(res);
}

Expand Down