Minor improvements to PagerDuty-Node

This commit is contained in:
Jan Oberhauser
2020-04-06 20:07:32 +02:00
parent 9ac740ab2a
commit 367b5aa29b
6 changed files with 9 additions and 11 deletions

View File

@@ -62,12 +62,11 @@ export async function pagerDutyApiRequestAllItems(this: IExecuteFunctions | ILoa
const returnData: IDataObject[] = [];
let responseData;
let uri;
query.limit = 100;
query.offset = 0;
do {
responseData = await pagerDutyApiRequest.call(this, method, endpoint, body, query, uri);
responseData = await pagerDutyApiRequest.call(this, method, endpoint, body, query);
query.offset++;
returnData.push.apply(returnData, responseData[propertyName]);
} while (
@@ -91,4 +90,3 @@ export function keysToSnakeCase(elements: IDataObject[] | IDataObject) : IDataOb
}
return elements;
}

View File

@@ -1,6 +1,6 @@
import {
INodeProperties,
} from 'n8n-workflow';
} from 'n8n-workflow';
export const incidentOperations = [
{

View File

@@ -1,6 +1,6 @@
import {
IDataObject,
} from "n8n-workflow";
} from 'n8n-workflow';
export interface IIncident {
assignments?: IDataObject[];

View File

@@ -1,6 +1,6 @@
import {
INodeProperties,
} from 'n8n-workflow';
} from 'n8n-workflow';
export const incidentNoteOperations = [
{

View File

@@ -5,16 +5,16 @@ import {
import {
IDataObject,
ILoadOptionsFunctions,
INodeTypeDescription,
INodeExecutionData,
INodeType,
INodePropertyOptions,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';
import {
keysToSnakeCase,
pagerDutyApiRequest,
pagerDutyApiRequestAllItems,
keysToSnakeCase,
} from './GenericFunctions';
import {
@@ -30,7 +30,7 @@ import {
import {
logEntryFields,
logEntryOperations,
} from './logEntryDescription';
} from './LogEntryDescription';
import {
IIncident,
@@ -345,7 +345,7 @@ export class PagerDuty implements INodeType {
responseData = await pagerDutyApiRequestAllItems.call(this, 'log_entries', 'GET', '/log_entries', {}, qs);
} else {
qs.limit = this.getNodeParameter('limit', 0) as number;
responseData = await pagerDutyApiRequest.call(this, 'GET', 'log_entries', {}, qs);
responseData = await pagerDutyApiRequest.call(this, 'GET', '/log_entries', {}, qs);
responseData = responseData.log_entries;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 330 B