Skip to content

Commit

Permalink
fix(Slack Node): Attachments fix (#8471)
Browse files Browse the repository at this point in the history
Co-authored-by: Elias Meire <elias@meire.dev>
  • Loading branch information
2 people authored and netroy committed Feb 2, 2024
1 parent 0aa23d5 commit 6883610
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/nodes-base/nodes/Slack/V2/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,21 @@ export function getMessageContent(
}
break;
case 'attachment':
content = { attachments: this.getNodeParameter('attachments', i) } as IDataObject;
const attachmentsUI = this.getNodeParameter('attachments', i) as IDataObject[];

const attachments: IDataObject[] = [];

for (const attachment of attachmentsUI) {
if (attachment.fields !== undefined) {
if ((attachment?.fields as IDataObject)?.item) {
attachment.fields = (attachment?.fields as IDataObject)?.item as IDataObject[];
}
}
attachments.push(attachment);
}

content = { attachments } as IDataObject;

if (includeLinkToWorkflow && Array.isArray(content.attachments)) {
content.attachments.push({
text: automatedMessage,
Expand Down

0 comments on commit 6883610

Please sign in to comment.