activecampaign-api-nodejs icon indicating copy to clipboard operation
activecampaign-api-nodejs copied to clipboard

Superfluous empty objects

Open leebenson opened this issue 8 years ago • 2 comments

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.

leebenson avatar Sep 14 '17 12:09 leebenson

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 avatar Feb 02 '18 22:02 bartboy011

@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.

bartboy011 avatar Mar 13 '18 16:03 bartboy011