mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(Merge Node): Fixing how paired items are handled in the merge node, when choosing a branch and selecting to return an empty object (#8479)
Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
@@ -29,7 +29,7 @@ import {
|
||||
} from './GenericFunctions';
|
||||
|
||||
import { optionsDescription } from './OptionsDescription';
|
||||
import { generatePairedItemData } from '../../../utils/utilities';
|
||||
import { preparePairedItemDataArray } from '@utils/utilities';
|
||||
|
||||
const versionDescription: INodeTypeDescription = {
|
||||
displayName: 'Merge',
|
||||
@@ -605,8 +605,15 @@ export class MergeV2 implements INodeType {
|
||||
returnData.push.apply(returnData, this.getInputData(1));
|
||||
}
|
||||
if (output === 'empty') {
|
||||
const itemData = generatePairedItemData(this.getInputData(0).length);
|
||||
returnData.push({ json: {}, pairedItem: itemData });
|
||||
const pairedItem = [
|
||||
...this.getInputData(0).map((inputData) => inputData.pairedItem),
|
||||
...this.getInputData(1).map((inputData) => inputData.pairedItem),
|
||||
].flatMap(preparePairedItemDataArray);
|
||||
|
||||
returnData.push({
|
||||
json: {},
|
||||
pairedItem,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user