diff --git a/packages/nodes-base/nodes/FacebookLeadAds/methods/listSearch.ts b/packages/nodes-base/nodes/FacebookLeadAds/methods/listSearch.ts index b7d3e64990..3f9e1f82b9 100644 --- a/packages/nodes-base/nodes/FacebookLeadAds/methods/listSearch.ts +++ b/packages/nodes-base/nodes/FacebookLeadAds/methods/listSearch.ts @@ -18,7 +18,7 @@ export async function pageList( value: page.id, url: `https://facebook.com/${page.id}`, })), - paginationToken: paging?.cursors?.after, + paginationToken: paging?.next ? paging?.cursors?.after : undefined, }; } @@ -37,6 +37,6 @@ export async function formList( name: form.name, value: form.id, })), - paginationToken: paging?.cursors?.after, + paginationToken: paging?.next ? paging?.cursors?.after : undefined, }; } diff --git a/packages/nodes-base/nodes/FacebookLeadAds/types.ts b/packages/nodes-base/nodes/FacebookLeadAds/types.ts index d1fc6050a3..dd4c8ca628 100644 --- a/packages/nodes-base/nodes/FacebookLeadAds/types.ts +++ b/packages/nodes-base/nodes/FacebookLeadAds/types.ts @@ -2,7 +2,7 @@ import type { GenericValue } from 'n8n-workflow'; export type BaseFacebookResponse = { data: TData }; export type BasePaginatedFacebookResponse = BaseFacebookResponse & { - paging: { cursors: { before?: string; after?: string } }; + paging: { cursors: { before?: string; after?: string }; next?: string }; }; export type FacebookAppWebhookSubscriptionsResponse = BaseFacebookResponse<