mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
fix: PairedItems various fixes (no-changelog) (#9357)
This commit is contained in:
parent
c9855e3dce
commit
5a3122f279
|
@ -692,8 +692,8 @@ export class FileMaker implements INodeType {
|
||||||
|
|
||||||
const action = this.getNodeParameter('action', 0) as string;
|
const action = this.getNodeParameter('action', 0) as string;
|
||||||
|
|
||||||
try {
|
for (let i = 0; i < items.length; i++) {
|
||||||
for (let i = 0; i < items.length; i++) {
|
try {
|
||||||
// Reset all values
|
// Reset all values
|
||||||
requestOptions = {
|
requestOptions = {
|
||||||
uri: '',
|
uri: '',
|
||||||
|
@ -807,17 +807,24 @@ export class FileMaker implements INodeType {
|
||||||
{ itemIndex: i },
|
{ itemIndex: i },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
returnData.push({ json: response });
|
returnData.push({ json: response, pairedItem: { item: i } });
|
||||||
}
|
} catch (error) {
|
||||||
} catch (error) {
|
if (this.continueOnFail()) {
|
||||||
if (error.node) {
|
returnData.push({
|
||||||
throw error;
|
json: { error: error.message },
|
||||||
}
|
pairedItem: { item: i },
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (error.node) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
|
||||||
throw new NodeOperationError(
|
throw new NodeOperationError(
|
||||||
this.getNode(),
|
this.getNode(),
|
||||||
`The action "${error.message}" is not implemented yet!`,
|
`The action "${error.message}" is not implemented yet!`,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await logout.call(this, token as string);
|
await logout.call(this, token as string);
|
||||||
|
|
|
@ -260,7 +260,10 @@ export async function execute(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodeVersion < 4 || dataMode === 'autoMapInputData') {
|
if (nodeVersion < 4 || dataMode === 'autoMapInputData') {
|
||||||
return items;
|
return items.map((item, index) => {
|
||||||
|
item.pairedItem = { item: index };
|
||||||
|
return item;
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
const returnData: INodeExecutionData[] = [];
|
const returnData: INodeExecutionData[] = [];
|
||||||
for (const [index, entry] of setData.entries()) {
|
for (const [index, entry] of setData.entries()) {
|
||||||
|
|
|
@ -430,7 +430,10 @@ export async function execute(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodeVersion < 4 || dataMode === 'autoMapInputData') {
|
if (nodeVersion < 4 || dataMode === 'autoMapInputData') {
|
||||||
return items;
|
return items.map((item, index) => {
|
||||||
|
item.pairedItem = { item: index };
|
||||||
|
return item;
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
const returnData: INodeExecutionData[] = [];
|
const returnData: INodeExecutionData[] = [];
|
||||||
for (const [index, entry] of mappedValues.entries()) {
|
for (const [index, entry] of mappedValues.entries()) {
|
||||||
|
|
|
@ -404,7 +404,10 @@ export async function execute(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodeVersion < 4 || dataMode === 'autoMapInputData') {
|
if (nodeVersion < 4 || dataMode === 'autoMapInputData') {
|
||||||
return items;
|
return items.map((item, index) => {
|
||||||
|
item.pairedItem = { item: index };
|
||||||
|
return item;
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
if (!updateData.length) {
|
if (!updateData.length) {
|
||||||
return [];
|
return [];
|
||||||
|
|
|
@ -368,7 +368,7 @@ export class MergeV2 implements INodeType {
|
||||||
let input1 = this.getInputData(0);
|
let input1 = this.getInputData(0);
|
||||||
let input2 = this.getInputData(1);
|
let input2 = this.getInputData(1);
|
||||||
|
|
||||||
if (input1.length === 0 || input2.length === 0) {
|
if (input1?.length === 0 || input2?.length === 0) {
|
||||||
// If data of any input is missing, return the data of
|
// If data of any input is missing, return the data of
|
||||||
// the input that contains data
|
// the input that contains data
|
||||||
return [[...input1, ...input2]];
|
return [[...input1, ...input2]];
|
||||||
|
@ -474,19 +474,19 @@ export class MergeV2 implements INodeType {
|
||||||
if (!input1) return [returnData];
|
if (!input1) return [returnData];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input1.length === 0 || input2.length === 0) {
|
if (input1?.length === 0 || input2?.length === 0) {
|
||||||
if (!input1.length && joinMode === 'keepNonMatches' && outputDataFrom === 'input1')
|
if (!input1?.length && joinMode === 'keepNonMatches' && outputDataFrom === 'input1')
|
||||||
return [returnData];
|
return [returnData];
|
||||||
if (!input2.length && joinMode === 'keepNonMatches' && outputDataFrom === 'input2')
|
if (!input2?.length && joinMode === 'keepNonMatches' && outputDataFrom === 'input2')
|
||||||
return [returnData];
|
return [returnData];
|
||||||
|
|
||||||
if (joinMode === 'keepMatches') {
|
if (joinMode === 'keepMatches') {
|
||||||
// Stop the execution
|
// Stop the execution
|
||||||
return [[]];
|
return [[]];
|
||||||
} else if (joinMode === 'enrichInput1' && input1.length === 0) {
|
} else if (joinMode === 'enrichInput1' && input1?.length === 0) {
|
||||||
// No data to enrich so stop
|
// No data to enrich so stop
|
||||||
return [[]];
|
return [[]];
|
||||||
} else if (joinMode === 'enrichInput2' && input2.length === 0) {
|
} else if (joinMode === 'enrichInput2' && input2?.length === 0) {
|
||||||
// No data to enrich so stop
|
// No data to enrich so stop
|
||||||
return [[]];
|
return [[]];
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue