Skip to content

Commit

Permalink
Merge pull request #7 from tdipadova3rd/tdp/pro-fix
Browse files Browse the repository at this point in the history
Fix pro support for endpoints missing params
  • Loading branch information
tdipadova3rd authored Feb 28, 2022
2 parents 0f1b47e + 5bf7c12 commit 9e3737d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -712,10 +712,14 @@ class CoinGecko {
* @returns {Object} - {params} Updated params with API key
*/
_insertApiKeyIntoParams(params) {
//Insert pro API key if params and API key exist
if (Utils.isObject(params) && this._shouldCallPro()) {
//Insert pro API key if API key exists
if (this._shouldCallPro()) {
if (!Utils.isObject(params)) {
params = {};
}
params['x_cg_pro_api_key'] = this._apiKey;
}

return params;
}

Expand Down

0 comments on commit 9e3737d

Please sign in to comment.