mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
✨ Added lead resource
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
import {
|
||||
IDataObject
|
||||
} from 'n8n-workflow';
|
||||
import { queryResult } from 'pg-promise';
|
||||
|
||||
export async function zohoApiRequest(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
|
||||
const options: OptionsWithUri = {
|
||||
@@ -41,14 +42,17 @@ export async function zohoApiRequestAllItems(this: IExecuteFunctions | ILoadOpti
|
||||
|
||||
let responseData;
|
||||
let uri: string | undefined;
|
||||
query.per_page = 200;
|
||||
query.page = 0;
|
||||
|
||||
do {
|
||||
responseData = await zohoApiRequest.call(this, method, endpoint, body, query, uri);
|
||||
uri = responseData.nextRecordsUrl;
|
||||
uri = responseData.info.more_records;
|
||||
returnData.push.apply(returnData, responseData[propertyName]);
|
||||
query.page++;
|
||||
} while (
|
||||
responseData.nextRecordsUrl !== undefined &&
|
||||
responseData.nextRecordsUrl !== null
|
||||
responseData.info.more_records !== undefined &&
|
||||
responseData.info.more_records === true
|
||||
);
|
||||
|
||||
return returnData;
|
||||
|
||||
Reference in New Issue
Block a user