From 1533536c8fa95331dd4e00103e02a89c22c40bf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 2 Mar 2021 11:54:47 -0300 Subject: [PATCH] :truck: Rename main generic functions --- .../nodes-base/nodes/Instagram/GenericFunctions.ts | 6 +++--- .../nodes-base/nodes/Instagram/Instagram.node.ts | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) 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`); } }