mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
fix(Zoho Node): Fix pagination issue (#3129)
This commit is contained in:
parent
5e54249c41
commit
47bbe9857b
|
@ -91,15 +91,13 @@ export async function zohoApiRequestAllItems(
|
||||||
const returnData: IDataObject[] = [];
|
const returnData: IDataObject[] = [];
|
||||||
|
|
||||||
let responseData;
|
let responseData;
|
||||||
let uri: string | undefined;
|
|
||||||
qs.per_page = 200;
|
qs.per_page = 200;
|
||||||
qs.page = 0;
|
qs.page = 1;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
responseData = await zohoApiRequest.call(this, method, endpoint, body, qs, uri);
|
responseData = await zohoApiRequest.call(this, method, endpoint, body, qs);
|
||||||
if (Array.isArray(responseData) && !responseData.length) return returnData;
|
if (Array.isArray(responseData) && !responseData.length) return returnData;
|
||||||
returnData.push(...responseData.data);
|
returnData.push(...responseData.data);
|
||||||
uri = responseData.info.more_records;
|
|
||||||
qs.page++;
|
qs.page++;
|
||||||
} while (
|
} while (
|
||||||
responseData.info.more_records !== undefined &&
|
responseData.info.more_records !== undefined &&
|
||||||
|
|
Loading…
Reference in a new issue