diff --git a/packages/nodes-base/nodes/Instagram/GenericFunctions.ts b/packages/nodes-base/nodes/Instagram/GenericFunctions.ts index 6ea3efdccd..ac293d478b 100644 --- a/packages/nodes-base/nodes/Instagram/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Instagram/GenericFunctions.ts @@ -11,7 +11,7 @@ import { IDataObject, } from 'n8n-workflow'; -export async function instagramBasicDisplayApiRequest( +export async function instagramApiRequest( this: IHookFunctions | IExecuteFunctions, method: string, endpoint: string, @@ -52,7 +52,7 @@ export async function instagramBasicDisplayApiRequest( /** * Make an authenticated API request to Instagram Basic Display API and return all results. */ -export async function instagramBasicDisplayApiRequestAllItems( +export async function instagramApiRequestAllItems( this: IHookFunctions | IExecuteFunctions, method: string, endpoint: string, @@ -66,7 +66,7 @@ export async function instagramBasicDisplayApiRequestAllItems( const limit = this.getNodeParameter('limit', 0, 0) as number; do { - responseData = await instagramBasicDisplayApiRequest.call(this, method, endpoint, qs, body); + responseData = await instagramApiRequest.call(this, method, endpoint, qs, body); returnData.push(...responseData.data); if (!returnAll && returnData.length > limit) { diff --git a/packages/nodes-base/nodes/Instagram/Instagram.node.ts b/packages/nodes-base/nodes/Instagram/Instagram.node.ts index 7e28513f08..604fe4cbe0 100644 --- a/packages/nodes-base/nodes/Instagram/Instagram.node.ts +++ b/packages/nodes-base/nodes/Instagram/Instagram.node.ts @@ -10,8 +10,8 @@ import { } from 'n8n-workflow'; import { - instagramBasicDisplayApiRequest, - instagramBasicDisplayApiRequestAllItems, + instagramApiRequest, + instagramApiRequestAllItems, } from './GenericFunctions'; import { @@ -101,7 +101,7 @@ export class Instagram implements INodeType { ? '/me' : `/${this.getNodeParameter('userId', i)}`; - responseData = await instagramBasicDisplayApiRequest.call(this, 'GET', endpoint, qs); + responseData = await instagramApiRequest.call(this, 'GET', endpoint, qs); } @@ -121,7 +121,7 @@ export class Instagram implements INodeType { const qs: IDataObject = { fields: 'caption,id,media_type,media_url,permalink,thumbnail_url,timestamp,username', }; - responseData = await instagramBasicDisplayApiRequestAllItems.call(this, 'GET', `/${mediaId}`, qs); + responseData = await instagramApiRequestAllItems.call(this, 'GET', `/${mediaId}`, qs); } if (operation === 'getAll') { @@ -138,12 +138,12 @@ export class Instagram implements INodeType { const qs: IDataObject = { fields: 'caption,children,id,media_type,media_url,permalink,thumbnail_url,timestamp,username', }; - responseData = await instagramBasicDisplayApiRequestAllItems.call(this, 'GET', `/${userId}/media`, qs); + responseData = await instagramApiRequestAllItems.call(this, 'GET', `/${userId}/media`, qs); } else if (type === 'albumMedia') { const mediaId = this.getNodeParameter('mediaId', i); - responseData = await instagramBasicDisplayApiRequestAllItems.call(this, 'GET', `/${mediaId}/children`); + responseData = await instagramApiRequestAllItems.call(this, 'GET', `/${mediaId}/children`); } }