mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 20:54:07 -08:00
fix(monicaCrm Node): fix pagination when using return all
This commit is contained in:
parent
49c85a1df8
commit
82827d0a12
|
@ -67,6 +67,8 @@ export async function monicaCrmApiRequestAllItems(
|
|||
const limit = this.getNodeParameter('limit', 0, 0) as number;
|
||||
|
||||
let totalItems = 0;
|
||||
qs.page = 1;
|
||||
qs.limit = 100;
|
||||
|
||||
let responseData;
|
||||
const returnData: IDataObject[] = [];
|
||||
|
@ -78,7 +80,7 @@ export async function monicaCrmApiRequestAllItems(
|
|||
if (!forLoader && !returnAll && returnData.length > limit) {
|
||||
return returnData.slice(0, limit);
|
||||
}
|
||||
|
||||
qs.page++;
|
||||
totalItems = responseData.meta.total;
|
||||
} while (totalItems > returnData.length);
|
||||
|
||||
|
|
Loading…
Reference in a new issue