refactor(core): Remove linting exceptions in nodes-base (no-changelog) (#4944)

This commit is contained in:
Michael Kret
2023-01-13 19:11:56 +02:00
committed by GitHub
parent d7732ea150
commit 6608e69457
254 changed files with 2687 additions and 2675 deletions

View File

@@ -9,6 +9,14 @@ import {
import { IDataObject } from 'n8n-workflow';
function getUri(resource: string, subdomain: string) {
if (resource.includes('webhooks')) {
return `https://${subdomain}.zendesk.com/api/v2${resource}`;
} else {
return `https://${subdomain}.zendesk.com/api/v2${resource}.json`;
}
}
export async function zendeskApiRequest(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
method: string,
@@ -33,7 +41,7 @@ export async function zendeskApiRequest(
method,
qs,
body,
uri: uri || getUri(resource, credentials.subdomain),
uri: uri ?? getUri(resource, credentials.subdomain),
json: true,
qsStringifyOptions: {
arrayFormat: 'brackets',
@@ -90,11 +98,3 @@ export function validateJSON(json: string | undefined): any {
}
return result;
}
function getUri(resource: string, subdomain: string) {
if (resource.includes('webhooks')) {
return `https://${subdomain}.zendesk.com/api/v2${resource}`;
} else {
return `https://${subdomain}.zendesk.com/api/v2${resource}.json`;
}
}