mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
🐛 Fix issue with pagination - Mautic node (#2686)
This commit is contained in:
@@ -75,15 +75,13 @@ export async function mauticApiRequestAllItems(this: IHookFunctions | IExecuteFu
|
|||||||
do {
|
do {
|
||||||
responseData = await mauticApiRequest.call(this, method, endpoint, body, query);
|
responseData = await mauticApiRequest.call(this, method, endpoint, body, query);
|
||||||
const values = Object.values(responseData[propertyName]);
|
const values = Object.values(responseData[propertyName]);
|
||||||
for (const value of values) {
|
//@ts-ignore
|
||||||
data.push(value as IDataObject);
|
returnData.push.apply(returnData, values);
|
||||||
}
|
query.start += query.limit;
|
||||||
returnData.push.apply(returnData, data);
|
|
||||||
query.start++;
|
|
||||||
data = [];
|
data = [];
|
||||||
} while (
|
} while (
|
||||||
responseData.total !== undefined &&
|
responseData.total !== undefined &&
|
||||||
((query.limit * query.start) - parseInt(responseData.total, 10)) < 0
|
(returnData.length - parseInt(responseData.total, 10)) < 0
|
||||||
);
|
);
|
||||||
|
|
||||||
return returnData;
|
return returnData;
|
||||||
|
|||||||
Reference in New Issue
Block a user