mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-26 05:04:05 -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;
|
const limit = this.getNodeParameter('limit', 0, 0) as number;
|
||||||
|
|
||||||
let totalItems = 0;
|
let totalItems = 0;
|
||||||
|
qs.page = 1;
|
||||||
|
qs.limit = 100;
|
||||||
|
|
||||||
let responseData;
|
let responseData;
|
||||||
const returnData: IDataObject[] = [];
|
const returnData: IDataObject[] = [];
|
||||||
|
@ -78,7 +80,7 @@ export async function monicaCrmApiRequestAllItems(
|
||||||
if (!forLoader && !returnAll && returnData.length > limit) {
|
if (!forLoader && !returnAll && returnData.length > limit) {
|
||||||
return returnData.slice(0, limit);
|
return returnData.slice(0, limit);
|
||||||
}
|
}
|
||||||
|
qs.page++;
|
||||||
totalItems = responseData.meta.total;
|
totalItems = responseData.meta.total;
|
||||||
} while (totalItems > returnData.length);
|
} while (totalItems > returnData.length);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue