From ff67e991b2899f9768060f942113182f90afecdf Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 27 Mar 2020 12:44:26 +0100 Subject: [PATCH] :zap: Make it possible to use JotForm accounts from Europe --- .../credentials/JotFormApi.credentials.ts | 17 +++++++++++++++++ .../nodes/JotForm/GenericFunctions.ts | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/nodes-base/credentials/JotFormApi.credentials.ts b/packages/nodes-base/credentials/JotFormApi.credentials.ts index 73d4cd267a..d1d9ab73c8 100644 --- a/packages/nodes-base/credentials/JotFormApi.credentials.ts +++ b/packages/nodes-base/credentials/JotFormApi.credentials.ts @@ -13,5 +13,22 @@ export class JotFormApi implements ICredentialType { type: 'string' as NodePropertyTypes, default: '', }, + { + displayName: 'API Domain', + name: 'apiDomain', + type: 'options' as NodePropertyTypes, + options: [ + { + name: 'api.jotform.com', + value: 'api.jotform.com', + }, + { + name: 'eu-api.jotform.com', + value: 'eu-api.jotform.com', + }, + ], + default: 'api.jotform.com', + description: 'The API domain to use. Use "eu-api.jotform.com" if your account is in based in Europe.', + }, ]; } diff --git a/packages/nodes-base/nodes/JotForm/GenericFunctions.ts b/packages/nodes-base/nodes/JotForm/GenericFunctions.ts index 343ca0acb2..555e06d69a 100644 --- a/packages/nodes-base/nodes/JotForm/GenericFunctions.ts +++ b/packages/nodes-base/nodes/JotForm/GenericFunctions.ts @@ -21,7 +21,7 @@ export async function jotformApiRequest(this: IHookFunctions | IExecuteFunctions method, qs, form: body, - uri: uri ||`http://api.jotform.com${resource}`, + uri: uri || `https://${credentials.apiDomain || 'api.jotform.com'}${resource}`, json: true }; if (!Object.keys(body).length) {