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