mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
fix(Strapi Node): Fix issue with pagination (#4991)
This commit is contained in:
parent
c906e7391b
commit
4253b48b26
|
@ -92,7 +92,7 @@ export async function strapiApiRequestAllItems(
|
||||||
let responseData;
|
let responseData;
|
||||||
if (apiVersion === 'v4') {
|
if (apiVersion === 'v4') {
|
||||||
query['pagination[pageSize]'] = 20;
|
query['pagination[pageSize]'] = 20;
|
||||||
query['pagination[page]'] = 0;
|
query['pagination[page]'] = 1;
|
||||||
do {
|
do {
|
||||||
({ data: responseData } = await strapiApiRequest.call(
|
({ data: responseData } = await strapiApiRequest.call(
|
||||||
this,
|
this,
|
||||||
|
@ -103,7 +103,7 @@ export async function strapiApiRequestAllItems(
|
||||||
undefined,
|
undefined,
|
||||||
headers,
|
headers,
|
||||||
));
|
));
|
||||||
query['pagination[page]'] += query['pagination[pageSize]'];
|
query['pagination[page]']++;
|
||||||
returnData.push.apply(returnData, responseData as IDataObject[]);
|
returnData.push.apply(returnData, responseData as IDataObject[]);
|
||||||
} while (responseData.length !== 0);
|
} while (responseData.length !== 0);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue