ActiveCampaign / activecampaign-api-nodejs

Node.js wrapper for the ActiveCampaign API
MIT License
39 stars 36 forks source link

Superfluous empty objects #44

Open leebenson opened 7 years ago

leebenson commented 7 years ago

Calling any API function requires an empty object be passed, e.g:

var account_view = ac.api("account/view", {}); // <-- {} needed, even without options

It would be far cleaner if on this line you had a default prop:

api: function(path, post_data = {})

... which would mean the api call could simply be:

ac.api("account/view");

... in the absence of options.

bartboy011 commented 6 years ago

Hey @leebenson, take a look at this commit on a PR I just opened, should address your issue here: https://github.com/ActiveCampaign/activecampaign-api-nodejs/pull/47/commits/55de1d62662b71c0ed3eba7c45d72177297f59f2

bartboy011 commented 6 years ago

@leebenson The PR fixing your issue is being considered for a future major version release. If you need this change implemented sooner than that please open a PR against the master branch.