mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor: Unify binary-data assertion across all nodes (no-changelog) (#5624)
This commit is contained in:
committed by
GitHub
parent
01a2160b3b
commit
5eb0d52459
@@ -84,20 +84,8 @@ export namespace SendInBlueNode {
|
||||
const { binaryPropertyName } = dataPropertyList;
|
||||
const dataMappingList = (binaryPropertyName as string).split(',');
|
||||
for (const attachmentDataName of dataMappingList) {
|
||||
const binaryPropertyAttachmentName = attachmentDataName;
|
||||
|
||||
const item = this.getInputData();
|
||||
|
||||
if (item.binary![binaryPropertyAttachmentName] === undefined) {
|
||||
throw new NodeOperationError(
|
||||
this.getNode(),
|
||||
`Item has no binary property called "${binaryPropertyName}"`,
|
||||
);
|
||||
}
|
||||
|
||||
const bufferFromIncomingData = await this.helpers.getBinaryDataBuffer(
|
||||
binaryPropertyAttachmentName,
|
||||
);
|
||||
const binaryData = this.helpers.assertBinaryData(attachmentDataName);
|
||||
const bufferFromIncomingData = await this.helpers.getBinaryDataBuffer(attachmentDataName);
|
||||
|
||||
const {
|
||||
data: content,
|
||||
@@ -111,7 +99,7 @@ export namespace SendInBlueNode {
|
||||
itemIndex,
|
||||
mimeType,
|
||||
fileExtension!,
|
||||
fileName || item.binary!.data.fileName!,
|
||||
fileName ?? binaryData.fileName!,
|
||||
);
|
||||
|
||||
attachment.push({ content, name });
|
||||
|
||||
Reference in New Issue
Block a user