mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor(core): Remove linting exceptions in nodes-base (no-changelog) (#4944)
This commit is contained in:
@@ -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`;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user