mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
fix(Hubspot Node): Fix search endpoints (#3640)
* Fixed Hubspot search endpoints
* 👕 Fix lint issue
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
parent
7ba85c4ab9
commit
16b9926cd2
|
@ -84,13 +84,17 @@ export async function hubspotApiRequestAllItems(this: IHookFunctions | IExecuteF
|
|||
responseData = await hubspotApiRequest.call(this, method, endpoint, body, query);
|
||||
query.offset = responseData.offset;
|
||||
query.vidOffset = responseData['vid-offset'];
|
||||
//Used by Search endpoints
|
||||
if (responseData['paging']) {
|
||||
body.after = responseData['paging']['next']['after'];
|
||||
}
|
||||
returnData.push.apply(returnData, responseData[propertyName]);
|
||||
//ticket:getAll endpoint does not support setting a limit, so return once the limit is reached
|
||||
if (query.limit && query.limit <= returnData.length && endpoint.includes('/tickets/paged')) {
|
||||
return returnData;
|
||||
}
|
||||
} while (
|
||||
responseData['hasMore'] || responseData['has-more']
|
||||
responseData['hasMore'] || responseData['has-more'] || responseData['paging']
|
||||
);
|
||||
return returnData;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue