mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(Google Sheets Node): Do not delete row_number key from input item (#13158)
This commit is contained in:
parent
67b951ee07
commit
da5e4be0fd
|
@ -15,7 +15,7 @@ describe('Google Sheet - Append', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should insert input data if sheet is empty', async () => {
|
it('should insert input data if sheet is empty', async () => {
|
||||||
mockExecuteFunctions.getInputData.mockReturnValueOnce([
|
const inputData = [
|
||||||
{
|
{
|
||||||
json: {
|
json: {
|
||||||
row_number: 3,
|
row_number: 3,
|
||||||
|
@ -27,7 +27,8 @@ describe('Google Sheet - Append', () => {
|
||||||
input: undefined,
|
input: undefined,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]);
|
];
|
||||||
|
mockExecuteFunctions.getInputData.mockReturnValueOnce(inputData);
|
||||||
|
|
||||||
mockExecuteFunctions.getNode.mockReturnValueOnce(mock<INode>({ typeVersion: 4.5 }));
|
mockExecuteFunctions.getNode.mockReturnValueOnce(mock<INode>({ typeVersion: 4.5 }));
|
||||||
mockExecuteFunctions.getNodeParameter
|
mockExecuteFunctions.getNodeParameter
|
||||||
|
@ -55,5 +56,6 @@ describe('Google Sheet - Append', () => {
|
||||||
range: 'Sheet1',
|
range: 'Sheet1',
|
||||||
valueInputMode: 'USER_ENTERED',
|
valueInputMode: 'USER_ENTERED',
|
||||||
});
|
});
|
||||||
|
expect(inputData[0].json).toEqual({ row_number: 3, name: 'NEW NAME', text: 'NEW TEXT' });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -278,7 +278,9 @@ export async function autoMapInputData(
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (item.json[ROW_NUMBER]) {
|
if (item.json[ROW_NUMBER]) {
|
||||||
delete item.json[ROW_NUMBER];
|
const { [ROW_NUMBER]: _, ...json } = item.json;
|
||||||
|
returnData.push(json);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
returnData.push(item.json);
|
returnData.push(item.json);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue