getonbrd / pipedrive-connect

Ruby library for the Pipedrive API.
MIT License
19 stars 30 forks source link

Fix post/put calls #12

Closed estani closed 3 years ago

estani commented 3 years ago

When creating a lead with an owner_id´ the current implementation fails. The reason is that params are sent as url parameters **as well as** body. For some parameters this seems to be tolerated, but forowner_id` it is not. The solution is to define the calls properly (if sending data over the body payload, do not add them to the url as well, which will break anyways if is large enough, e.g. when creating a large note)

This PR:

j4rs commented 3 years ago

Great catch, don't you think debug_http serves the purpose to debug http body so there is no need to add a new flag?

estani commented 3 years ago

The problem is the amount of information... the body might be huge, specially when handling notes.... but a search might return a very large json, which will make it impossible to read and probably flush the console...

This can also be change into some kind of "LEVEL". Because of the volume of information, I think the current levels are needed: 1) Just the basic calls with url & HTTP verb, nothing more 2) Add all parameters and headers 3) add the bodies

Feel free to change it. We are good working with the fork right now, seem to work quite well.

j4rs commented 3 years ago

It makes sense, I will approve the PR as it fixes an important bug 👏.

Debugging the body (nice feature) can be refactored in a different PR.

Thanks for the great work 💪.