Minor improvements on Signl4 Node

This commit is contained in:
Jan Oberhauser 2021-01-31 20:07:32 +01:00
parent 73189eda87
commit 044218bba7
2 changed files with 7 additions and 9 deletions

View file

@ -8,8 +8,8 @@ import {
import {
OptionsWithUri,
} from 'request';
} from 'request';
/**
* Make an API request to SIGNL4
*
@ -21,7 +21,7 @@ import {
* @param {string} teamSecret
* @param {object} options
* @returns {Promise<any>}
*
*
*/
export async function SIGNL4ApiRequest(this: IExecuteFunctions, method: string, body: string, query: IDataObject = {}, option: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
@ -48,8 +48,6 @@ export async function SIGNL4ApiRequest(this: IExecuteFunctions, method: string,
}
options = Object.assign({}, options, option);
console.log(options);
try {
return await this.helpers.request!(options);
} catch (error) {

View file

@ -264,8 +264,8 @@ export class Signl4 implements INodeType {
// Send alert
if (operation === 'send') {
const message = this.getNodeParameter('message', i) as string;
const additionalFields = this.getNodeParameter('additionalFields',i) as IDataObject;
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
const data: IDataObject = {
message,
};
@ -331,7 +331,7 @@ export class Signl4 implements INodeType {
}
}
}
responseData = await SIGNL4ApiRequest.call(
this,
'POST',
@ -350,7 +350,7 @@ export class Signl4 implements INodeType {
data['X-S4-ExternalID'] = this.getNodeParameter('externalId', i) as string;
data['X-S4-Status'] = 'resolved';
data['X-S4-SourceSystem'] = 'n8n';
responseData = await SIGNL4ApiRequest.call(