From 001b93151b442ff4cbe97230cdb5071ebbe0c441 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 10 Nov 2020 19:16:35 +0100 Subject: [PATCH] :zap: Minor improvements to Gotify Node --- packages/nodes-base/credentials/GotifyApi.credentials.ts | 9 +++++---- packages/nodes-base/nodes/Gotify/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Gotify/Gotify.node.ts | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/nodes-base/credentials/GotifyApi.credentials.ts b/packages/nodes-base/credentials/GotifyApi.credentials.ts index 2205ea9176..5f90e6726b 100644 --- a/packages/nodes-base/credentials/GotifyApi.credentials.ts +++ b/packages/nodes-base/credentials/GotifyApi.credentials.ts @@ -8,24 +8,25 @@ export class GotifyApi implements ICredentialType { displayName = 'Gotify API'; properties = [ { - displayName: 'APP API Token', + displayName: 'App API Token', name: 'appApiToken', type: 'string' as NodePropertyTypes, default: '', - description: '(Optional) Needed for message creation', + description: '(Optional) Needed for message creation.', }, { displayName: 'Client API Token', name: 'clientApiToken', type: 'string' as NodePropertyTypes, default: '', - description: '(Optional) Needed for everything (delete, getAll) but message creation', + description: '(Optional) Needed for everything (delete, getAll) but message creation.', }, { displayName: 'URL', name: 'url', type: 'string' as NodePropertyTypes, - default: `Host's URL`, + default: '', + description: 'The URL of the Gotify host.', }, ]; } diff --git a/packages/nodes-base/nodes/Gotify/GenericFunctions.ts b/packages/nodes-base/nodes/Gotify/GenericFunctions.ts index b9655dc4ed..ab694fe577 100644 --- a/packages/nodes-base/nodes/Gotify/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Gotify/GenericFunctions.ts @@ -35,7 +35,7 @@ export async function gotifyApiRequest(this: IExecuteFunctions | IExecuteSingleF //@ts-ignore return await this.helpers.request.call(this, options); } catch (error) { - + if (error.response && error.response.body && error.response.body.errorDescription) { const message = error.response.body.errorDescription; // Try to return the error prettier diff --git a/packages/nodes-base/nodes/Gotify/Gotify.node.ts b/packages/nodes-base/nodes/Gotify/Gotify.node.ts index a2cb407484..1c6179efc6 100644 --- a/packages/nodes-base/nodes/Gotify/Gotify.node.ts +++ b/packages/nodes-base/nodes/Gotify/Gotify.node.ts @@ -204,7 +204,7 @@ export class Gotify implements INodeType { const body: IDataObject = { message, }; - + Object.assign(body, additionalFields); responseData = await gotifyApiRequest.call(