mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(Merge Node): Enrich input 2 fix (#6526)
This commit is contained in:
committed by
कारतोफ्फेलस्क्रिप्ट™
parent
b6202b5585
commit
70822ce988
@@ -132,12 +132,8 @@ export function findMatches(
|
||||
fieldsToMatch: PairToMatch[],
|
||||
options: MatchFieldsOptions,
|
||||
) {
|
||||
let data1 = [...input1];
|
||||
let data2 = [...input2];
|
||||
|
||||
if (options.joinMode === 'enrichInput2') {
|
||||
[data1, data2] = [data2, data1];
|
||||
}
|
||||
const data1 = [...input1];
|
||||
const data2 = [...input2];
|
||||
|
||||
const isEntriesEqual = fuzzyCompare(options.fuzzyCompare as boolean);
|
||||
const disableDotNotation = options.disableDotNotation || false;
|
||||
@@ -263,12 +259,8 @@ export function mergeMatched(
|
||||
let binary: IBinaryKeyData = {};
|
||||
|
||||
if (resolveClash === 'addSuffix') {
|
||||
let suffix1 = '1';
|
||||
let suffix2 = '2';
|
||||
|
||||
if (joinMode === 'enrichInput2') {
|
||||
[suffix1, suffix2] = [suffix2, suffix1];
|
||||
}
|
||||
const suffix1 = '1';
|
||||
const suffix2 = '2';
|
||||
|
||||
[entry] = addSuffixToEntriesKeys([entry], suffix1);
|
||||
matches = addSuffixToEntriesKeys(matches, suffix2);
|
||||
@@ -279,15 +271,15 @@ export function mergeMatched(
|
||||
...matches.map((item) => item.binary as IDataObject),
|
||||
);
|
||||
} else {
|
||||
let preferInput1 = 'preferInput1';
|
||||
let preferInput2 = 'preferInput2';
|
||||
|
||||
if (joinMode === 'enrichInput2') {
|
||||
[preferInput1, preferInput2] = [preferInput2, preferInput1];
|
||||
}
|
||||
const preferInput1 = 'preferInput1';
|
||||
const preferInput2 = 'preferInput2';
|
||||
|
||||
if (resolveClash === undefined) {
|
||||
resolveClash = 'preferInput2';
|
||||
if (joinMode !== 'enrichInput2') {
|
||||
resolveClash = 'preferInput2';
|
||||
} else {
|
||||
resolveClash = 'preferInput1';
|
||||
}
|
||||
}
|
||||
|
||||
if (resolveClash === preferInput1) {
|
||||
|
||||
Reference in New Issue
Block a user