Skip to content

Commit

Permalink
fix(Zoho Node): Fix pagination issue (#3129)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joffcom authored Apr 14, 2022
1 parent 5e54249 commit 47bbe98
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/nodes-base/nodes/Zoho/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,13 @@ export async function zohoApiRequestAllItems(
const returnData: IDataObject[] = [];

let responseData;
let uri: string | undefined;
qs.per_page = 200;
qs.page = 0;
qs.page = 1;

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;
returnData.push(...responseData.data);
uri = responseData.info.more_records;
qs.page++;
} while (
responseData.info.more_records !== undefined &&
Expand Down

0 comments on commit 47bbe98

Please sign in to comment.