mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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;
|
break;
|
||||||
case 'attachment':
|
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)) {
|
if (includeLinkToWorkflow && Array.isArray(content.attachments)) {
|
||||||
content.attachments.push({
|
content.attachments.push({
|
||||||
text: automatedMessage,
|
text: automatedMessage,
|
||||||
|
|
Loading…
Reference in a new issue