fix(core): Missing pairedItem fixes (#8394)

This commit is contained in:
Michael Kret
2024-01-19 13:47:25 +02:00
committed by GitHub
parent 2c14371481
commit 284d965b5a
12 changed files with 37 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ import type {
IHookFunctions,
ILoadOptionsFunctions,
INodeExecutionData,
IPairedItemData,
IPollFunctions,
} from 'n8n-workflow';
import { jsonParse, NodeOperationError } from 'n8n-workflow';
@@ -106,11 +107,15 @@ export async function downloadRecordAttachments(
this: IExecuteFunctions | IPollFunctions,
records: IDataObject[],
fieldNames: string[],
pairedItem?: IPairedItemData[],
): Promise<INodeExecutionData[]> {
const elements: INodeExecutionData[] = [];
for (const record of records) {
const element: INodeExecutionData = { json: {}, binary: {} };
if (pairedItem) {
element.pairedItem = pairedItem;
}
element.json = record as unknown as IDataObject;
for (const fieldName of fieldNames) {
let attachments = record[fieldName] as IAttachment[];

View File

@@ -521,6 +521,7 @@ export class NocoDB implements INodeType {
this,
responseData as IDataObject[],
downloadFieldNames,
[{ item: i }],
);
data.push(...response);
}
@@ -584,6 +585,7 @@ export class NocoDB implements INodeType {
this,
[responseData as IDataObject],
downloadFieldNames,
[{ item: i }],
);
const newItem = {
binary: data[0].binary,