fix(Slack Node): Attachments fix (#8471)

Co-authored-by: Elias Meire <elias@meire.dev>
This commit is contained in:
Michael Kret 2024-02-01 11:26:04 +00:00 committed by GitHub
parent 1e02d73ad7
commit 254700a059
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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