diff --git a/packages/nodes-base/nodes/Trello/Trello.node.ts b/packages/nodes-base/nodes/Trello/Trello.node.ts index cd3b0a87c9..3a1e10e090 100644 --- a/packages/nodes-base/nodes/Trello/Trello.node.ts +++ b/packages/nodes-base/nodes/Trello/Trello.node.ts @@ -1329,7 +1329,6 @@ export class Trello implements INodeType { // ---------------------------------- // attachment // ---------------------------------- - { displayName: 'Operation', name: 'operation', @@ -1360,7 +1359,7 @@ export class Trello implements INodeType { { name: 'List', value: 'list', - description: 'List all attachments', + description: 'List all attachments for the card', } ], default: 'list', @@ -1372,7 +1371,7 @@ export class Trello implements INodeType { // ---------------------------------- { displayName: 'Card ID', - name: 'id', + name: 'cardId', type: 'string', default: '', required: true, @@ -1440,39 +1439,31 @@ export class Trello implements INodeType { }, description: 'The ID of the attachment to get.', }, + + // ---------------------------------- + // attachment:delete + // ---------------------------------- { - displayName: 'Additional Fields', - name: 'additionalFields', - type: 'collection', - placeholder: 'Add Field', + displayName: 'Card ID', + name: 'cardId', + type: 'string', + default: '', + required: true, displayOptions: { show: { operation: [ - 'create', + 'delete', ], resource: [ 'attachment', ], }, }, - default: {}, - options: [ - { - displayName: 'Fields', - name: 'fields', - type: 'string', - default: 'all', - description: 'Fields to return. Either "all" or a comma-separated list of fields.', - }, - ], + description: 'The ID of the Card to get attachments.', }, - - // ---------------------------------- - // attachment:delete - // ---------------------------------- { displayName: 'Attachment ID', - name: 'attachmentId', + name: 'id', type: 'string', default: '', required: true, @@ -1494,7 +1485,7 @@ export class Trello implements INodeType { // ---------------------------------- { displayName: 'Card ID', - name: 'id', + name: 'cardId', type: 'string', default: '', required: true, @@ -1542,7 +1533,7 @@ export class Trello implements INodeType { // ---------------------------------- { displayName: 'Card ID', - name: 'id', + name: 'cardId', type: 'string', default: '', required: true, @@ -1560,7 +1551,7 @@ export class Trello implements INodeType { }, { displayName: 'Attachment ID', - name: 'attachmentId', + name: 'id', type: 'string', default: '', required: true, @@ -1818,29 +1809,29 @@ export class Trello implements INodeType { // ---------------------------------- requestMethod = 'POST'; - const id = this.getNodeParameter('id', i) as string; + const cardId = this.getNodeParameter('cardId', i) as string; const name = this.getNodeParameter('name', i) as string; const url = this.getNodeParameter('url', i) as string; const mimeType = this.getNodeParameter('mimeType', i) as string; - endpoint = `cards/${id}/attachments`; + endpoint = `cards/${cardId}/attachments`; - const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; - Object.assign(qs, additionalFields); + Object.assign(qs, { + name, + mimeType, + url + }); } else if (operation === 'delete') { // ---------------------------------- - // create + // delete // ---------------------------------- requestMethod = 'DELETE'; + const cardId = this.getNodeParameter('cardId', i) as string; const id = this.getNodeParameter('id', i) as string; - const attachmentId = this.getNodeParameter('attachmentId', i) as string; - endpoint = `cards/${id}/attachments/${attachmentId}`; - - const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; - Object.assign(qs, additionalFields); + endpoint = `cards/${cardId}/attachments/${id}`; } else if (operation === 'get') { // ---------------------------------- @@ -1849,24 +1840,24 @@ export class Trello implements INodeType { requestMethod = 'GET'; + const cardId = this.getNodeParameter('cardId', i) as string; const id = this.getNodeParameter('id', i) as string; - const attachmentId = this.getNodeParameter('attachmentId', i) as string; - endpoint = `cards/${id}/attachments/${attachmentId}`; + endpoint = `cards/${cardId}/attachments/${id}`; const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; Object.assign(qs, additionalFields); - } else if { + } else if (operation === 'list') { // ---------------------------------- // list // ---------------------------------- requestMethod = 'GET'; - const id = this.getNodeParameter('id', i) as string; + const cardId = this.getNodeParameter('cardId', i) as string; - endpoint = `cards/${id}/attachments`; + endpoint = `cards/${cardId}/attachments`; const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; Object.assign(qs, additionalFields);