mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(monicaCrm Node): fix pagination when using return all
This commit is contained in:
committed by
GitHub
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user