Fix typo

This commit is contained in:
Jan Oberhauser 2020-05-08 14:46:38 +02:00
parent e09a4b91ad
commit eea5f3775f

View file

@ -397,12 +397,12 @@ export class Rocketchat implements INodeType {
async executeSingle(this: IExecuteSingleFunctions): Promise<INodeExecutionData> {
const resource = this.getNodeParameter('resource') as string;
const opeation = this.getNodeParameter('operation') as string;
const operation = this.getNodeParameter('operation') as string;
let response;
if (resource === 'chat') {
//https://rocket.chat/docs/developer-guides/rest-api/chat/postmessage
if (opeation === 'postMessage') {
if (operation === 'postMessage') {
const channel = this.getNodeParameter('channel') as string;
const text = this.getNodeParameter('text') as string;
const options = this.getNodeParameter('options') as IDataObject;
@ -489,11 +489,7 @@ export class Rocketchat implements INodeType {
body.attachments = validateJSON(this.getNodeParameter('attachmentsJson') as string);
}
try {
response = await rocketchatApiRequest.call(this, '/chat', 'POST', 'postMessage', body);
} catch (err) {
throw new Error(`Rocketchat Error: ${err}`);
}
response = await rocketchatApiRequest.call(this, '/chat', 'POST', 'postMessage', body);
}
}