mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00: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:
committed by
GitHub
parent
7ba85c4ab9
commit
16b9926cd2
@@ -84,13 +84,17 @@ export async function hubspotApiRequestAllItems(this: IHookFunctions | IExecuteF
|
|||||||
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.vidOffset = responseData['vid-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]);
|
returnData.push.apply(returnData, responseData[propertyName]);
|
||||||
//ticket:getAll endpoint does not support setting a limit, so return once the limit is reached
|
//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')) {
|
if (query.limit && query.limit <= returnData.length && endpoint.includes('/tickets/paged')) {
|
||||||
return returnData;
|
return returnData;
|
||||||
}
|
}
|
||||||
} while (
|
} while (
|
||||||
responseData['hasMore'] || responseData['has-more']
|
responseData['hasMore'] || responseData['has-more'] || responseData['paging']
|
||||||
);
|
);
|
||||||
return returnData;
|
return returnData;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user