Skip to content

Commit

Permalink
fix(Hubspot Node): Fix search endpoints (#3640)
Browse files Browse the repository at this point in the history
* Fixed Hubspot search endpoints

* 👕 Fix lint issue

Co-authored-by: Jan Oberhauser <[email protected]>
  • Loading branch information
Joffcom and janober authored Jul 4, 2022
1 parent 7ba85c4 commit 16b9926
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit 16b9926

Please sign in to comment.