As you see there is some extra parameters which we can provide with requests.
In some methods we can't setup this options. For example I need to setup wfTrigger: true on every Zoho insert action but I have no possibility to do it via method usage.
So I propose to change this
insertRecords: (records, cb) ->
if not _.isArray(records)
throw new Error('Requires array of records')
if records.length < 1
throw new Error('Requires as least one record')
query = {
newFormat: 1,
xmlData: @build(records)
}
to this part
insertRecords: (records, _query, cb) ->
if not _.isArray(records)
throw new Error('Requires array of records')
if records.length < 1
throw new Error('Requires as least one record')
if _.isFunction(_query)
cb = _query
_query = {}
query = _.extend({
newFormat: 1,
xmlData: @build(records)
}, _query)
It works perfectly and has backward compatibility. I will post pull request and try to add extra test for this case
As you see there is some extra parameters which we can provide with requests.
In some methods we can't setup this options. For example I need to setup wfTrigger: true on every Zoho insert action but I have no possibility to do it via method usage.
So I propose to change this
to this part
It works perfectly and has backward compatibility. I will post pull request and try to add extra test for this case