Minor improvements to Gotify Node

This commit is contained in:
Jan Oberhauser 2020-11-10 19:16:35 +01:00
parent 13e3efe312
commit 001b93151b
3 changed files with 7 additions and 6 deletions

View file

@ -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.',
},
];
}

View file

@ -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

View file

@ -204,7 +204,7 @@ export class Gotify implements INodeType {
const body: IDataObject = {
message,
};
Object.assign(body, additionalFields);
responseData = await gotifyApiRequest.call(