Open mfoolio opened 1 year ago
We deal with this in our CRM module, so if you feel like it you can check that implementation (https://github.com/Weble/ZohoCRMApi and let me know if that make sense in this use case, and we'll accept a PR for this gladly :)
Attempting to update multiple ZohoBooks "Item" records with the "update" method quickly leads to API rate limits.
Using a PUT to the bare "/items" with a JSON object of many Item records will update them all with a single API call. The reply data is a JSON array with single top-level array of "items" with each record being the full updated individual Item and also the response "Code" and "Message" that would normally be returned from a single Item's update/PUT call.
While this ZohoBooksApi module allows to send an update to the bare "/items" by providing "null" as the id to the ->update() method (which in turns sends it to ->put()), the current release does not properly handle the resulting data response from the Zoho API.
Two issues presented:
To resolve for immediate use I modified code as follows:
Would it be more desirable to create another Module method such as updateMany() instead of passing in a null id? Are there consequences or other cases where processResult() shouldn't just return the JSON data object?