From 4253b48b26d1625cd2fb7f38159f9528cea45f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Mart=C3=ADnez?= <91728333+adrian-martinez-vdshop@users.noreply.github.com> Date: Mon, 3 Jul 2023 17:05:28 +0200 Subject: [PATCH] fix(Strapi Node): Fix issue with pagination (#4991) --- packages/nodes-base/nodes/Strapi/GenericFunctions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/nodes/Strapi/GenericFunctions.ts b/packages/nodes-base/nodes/Strapi/GenericFunctions.ts index 9c3fd5ed6a..d5b0aa1834 100644 --- a/packages/nodes-base/nodes/Strapi/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Strapi/GenericFunctions.ts @@ -92,7 +92,7 @@ export async function strapiApiRequestAllItems( let responseData; if (apiVersion === 'v4') { query['pagination[pageSize]'] = 20; - query['pagination[page]'] = 0; + query['pagination[page]'] = 1; do { ({ data: responseData } = await strapiApiRequest.call( this, @@ -103,7 +103,7 @@ export async function strapiApiRequestAllItems( undefined, headers, )); - query['pagination[page]'] += query['pagination[pageSize]']; + query['pagination[page]']++; returnData.push.apply(returnData, responseData as IDataObject[]); } while (responseData.length !== 0); } else {