StuartApp / stuart-client-js

Stuart JavaScript client
MIT License
2 stars 6 forks source link

HttpClient.performGet(resource) - Add support for URL query parameters #3

Closed KasparasMasiukas closed 6 years ago

KasparasMasiukas commented 6 years ago

Some endpoints (e.g. /v2/addresses/validate) require some query string parameters. It would be convenient if HttpClient.performGet would accept an additional parameter object "params", which the performGet method would attach to the request object (field "qs" of the Request.get() options).

The method's signature could become HttpClient.performGet(resource, params), without breaking the current functionality, as the new parameter "params" would, of course, be optional.

maximilientyc commented 6 years ago

That would be awesome indeed! Please tell us if want to start a pull request, we will be very responsive to review it 🤓

maximilientyc commented 6 years ago

Otherwise we will prioritise it internally.

KasparasMasiukas commented 6 years ago

Sure, I am opening a pull request in a few minutes, as soon as my test passes!

KasparasMasiukas commented 6 years ago

I suppose I need to be declared a contributor in this repository, since I get "Access denied" errors trying to push a new branch for pull request.

maximilientyc commented 6 years ago

Hey @Kasparas42180 have you followed this steps to created a pull request?

git clone https://github.com/<your-username-goes-here>/stuart-client-js.git
KasparasMasiukas commented 6 years ago

All done!

KasparasMasiukas commented 6 years ago

Could you update the version and make it available on npm, please?

maximilientyc commented 6 years ago

doing it right now 👍

KasparasMasiukas commented 6 years ago

🥇

maximilientyc commented 6 years ago

done, version 1.1.0 published to https://www.npmjs.com/package/stuart-client-js/v/1.1.0

KasparasMasiukas commented 6 years ago

Thanks a lot! Going to integrate that into our systems :smiley: