mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
fix(Slack Node): Attachments fix (#8471)
Co-authored-by: Elias Meire <elias@meire.dev>
This commit is contained in:
parent
1e02d73ad7
commit
254700a059
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue