mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
🐛 Fix pagination issue on Hubspot Node (#1281)
This commit is contained in:
parent
b0e17453f4
commit
51afcd8ad5
|
@ -89,9 +89,10 @@ export async function hubspotApiRequestAllItems(this: IHookFunctions | IExecuteF
|
||||||
do {
|
do {
|
||||||
responseData = await hubspotApiRequest.call(this, method, endpoint, body, query);
|
responseData = await hubspotApiRequest.call(this, method, endpoint, body, query);
|
||||||
query.offset = responseData.offset;
|
query.offset = responseData.offset;
|
||||||
query['vid-offset'] = responseData['vid-offset'];
|
query.vidOffset = responseData['vid-offset'];
|
||||||
returnData.push.apply(returnData, responseData[propertyName]);
|
returnData.push.apply(returnData, responseData[propertyName]);
|
||||||
if (query.limit && query.limit <= returnData.length) {
|
//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;
|
return returnData;
|
||||||
}
|
}
|
||||||
} while (
|
} while (
|
||||||
|
@ -102,7 +103,6 @@ export async function hubspotApiRequestAllItems(this: IHookFunctions | IExecuteF
|
||||||
return returnData;
|
return returnData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function validateJSON(json: string | undefined): any { // tslint:disable-line:no-any
|
export function validateJSON(json: string | undefined): any { // tslint:disable-line:no-any
|
||||||
let result;
|
let result;
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue