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