mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(Lemlist Node): Add V2 to support more API operations (#10615)
This commit is contained in:
@@ -59,13 +59,23 @@ export async function lemlistApiRequestAllItems(
|
||||
|
||||
qs.limit = 100;
|
||||
qs.offset = 0;
|
||||
|
||||
do {
|
||||
responseData = await lemlistApiRequest.call(this, method, endpoint, {}, qs);
|
||||
returnData.push(...(responseData as IDataObject[]));
|
||||
qs.offset += qs.limit;
|
||||
} while (responseData.length !== 0);
|
||||
return returnData;
|
||||
//when using v2, the pagination is different
|
||||
if (qs.version && qs.version === 'v2') {
|
||||
qs.page = 1;
|
||||
do {
|
||||
responseData = await lemlistApiRequest.call(this, method, endpoint, {}, qs);
|
||||
returnData.push(...(responseData as IDataObject[]));
|
||||
qs.page++;
|
||||
} while (responseData.totalPage && qs.page < responseData.totalPage);
|
||||
return returnData;
|
||||
} else {
|
||||
do {
|
||||
responseData = await lemlistApiRequest.call(this, method, endpoint, {}, qs);
|
||||
returnData.push(...(responseData as IDataObject[]));
|
||||
qs.offset += qs.limit;
|
||||
} while (responseData.length !== 0);
|
||||
return returnData;
|
||||
}
|
||||
}
|
||||
|
||||
export function getEvents() {
|
||||
|
||||
Reference in New Issue
Block a user