diff --git a/packages/nodes-base/nodes/Rocketchat/GenericFunctions.ts b/packages/nodes-base/nodes/Rocketchat/GenericFunctions.ts index 0d4d1c4a0d..ec19527085 100644 --- a/packages/nodes-base/nodes/Rocketchat/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Rocketchat/GenericFunctions.ts @@ -4,10 +4,9 @@ import { import { IExecuteFunctions, - IHookFunctions, ILoadOptionsFunctions, } from 'n8n-core'; -import { NodeApiError, NodeOperationError, } from 'n8n-workflow'; +import { NodeApiError } from 'n8n-workflow'; export async function rocketchatApiRequest(this: IExecuteFunctions | ILoadOptionsFunctions, resource: string, method: string, operation: string, body: any = {}, headers?: object): Promise { // tslint:disable-line:no-any const credentials = await this.getCredentials('rocketchatApi'); @@ -23,7 +22,7 @@ export async function rocketchatApiRequest(this: IExecuteFunctions | ILoadOption delete options.body; } try { - return await this.helpers.request!(options); + return await this.helpers.requestWithAuthentication.call(this, 'rocketchatApi', options); } catch (error) { throw new NodeApiError(this.getNode(), error); }