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:
@@ -4,6 +4,12 @@ import { IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-core';
|
||||
|
||||
import { IDataObject, IHookFunctions, IWebhookFunctions, NodeApiError } from 'n8n-workflow';
|
||||
|
||||
/**
|
||||
* Return the base API URL based on the user's environment.
|
||||
*/
|
||||
const getBaseUrl = ({ environment, domain, subdomain }: ERPNextApiCredentials) =>
|
||||
environment === 'cloudHosted' ? `https://${subdomain}.erpnext.com` : domain;
|
||||
|
||||
export async function erpNextApiRequest(
|
||||
this: IExecuteFunctions | IWebhookFunctions | IHookFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
@@ -24,7 +30,7 @@ export async function erpNextApiRequest(
|
||||
method,
|
||||
body,
|
||||
qs: query,
|
||||
uri: uri || `${baseUrl}${resource}`,
|
||||
uri: uri ?? `${baseUrl}${resource}`,
|
||||
json: true,
|
||||
rejectUnauthorized: !credentials.allowUnauthorizedCerts,
|
||||
};
|
||||
@@ -77,12 +83,6 @@ export async function erpNextApiRequestAllItems(
|
||||
return returnData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the base API URL based on the user's environment.
|
||||
*/
|
||||
const getBaseUrl = ({ environment, domain, subdomain }: ERPNextApiCredentials) =>
|
||||
environment === 'cloudHosted' ? `https://${subdomain}.erpnext.com` : domain;
|
||||
|
||||
type ERPNextApiCredentials = {
|
||||
apiKey: string;
|
||||
apiSecret: string;
|
||||
|
||||
Reference in New Issue
Block a user