Skip to content

Commit

Permalink
Merge pull request #27 from thisdotvoid/patch-1
Browse files Browse the repository at this point in the history
allow non user-dependent requests #26
  • Loading branch information
jmdiego committed Mar 3, 2018
2 parents 9bda272 + 65473cd commit 7affe51
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fitbit-api-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ module.exports = class FitbitApiClient {
}

getUrl(path, userId){
return `https://api.fitbit.com/${this.apiVersion}/user/${userId || '-'}${path}`;
let userSubPath = userId === false ? '' : `/user/${userId || '-'}`;
return `https://api.fitbit.com/${this.apiVersion}${userSubPath}${path}`;
}

mergeHeaders(accessToken, extraHeaders) {
Expand Down

0 comments on commit 7affe51

Please sign in to comment.