Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

n8n-4004 - Fixed Hubspot search endpoints #3640

Merged
merged 2 commits into from
Jul 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/nodes-base/nodes/Hubspot/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down