mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
⚡ Added ticket resource
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import { OptionsWithUri } from 'request';
|
||||
import {
|
||||
OptionsWithUri,
|
||||
} from 'request';
|
||||
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
IHookFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IExecuteSingleFunctions
|
||||
IExecuteSingleFunctions,
|
||||
} from 'n8n-core';
|
||||
|
||||
import {
|
||||
@@ -50,7 +52,7 @@ export async function hubspotApiRequestAllItems(this: IHookFunctions | IExecuteF
|
||||
|
||||
let responseData;
|
||||
|
||||
query.limit = 250;
|
||||
query.limit = query.limit || 250;
|
||||
query.count = 100;
|
||||
|
||||
do {
|
||||
@@ -58,6 +60,9 @@ export async function hubspotApiRequestAllItems(this: IHookFunctions | IExecuteF
|
||||
query.offset = responseData.offset;
|
||||
query['vid-offset'] = responseData['vid-offset'];
|
||||
returnData.push.apply(returnData, responseData[propertyName]);
|
||||
if (query.limit && query.limit <= returnData.length) {
|
||||
return returnData;
|
||||
}
|
||||
} while (
|
||||
responseData['has-more'] !== undefined &&
|
||||
responseData['has-more'] !== null &&
|
||||
|
||||
Reference in New Issue
Block a user