Skip to content

Commit

Permalink
fix(Google Sheets Node): Do not delete row_number key from input item (
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-radency authored Feb 11, 2025
1 parent 67b951e commit da5e4be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Google Sheet - Append', () => {
});

it('should insert input data if sheet is empty', async () => {
mockExecuteFunctions.getInputData.mockReturnValueOnce([
const inputData = [
{
json: {
row_number: 3,
Expand All @@ -27,7 +27,8 @@ describe('Google Sheet - Append', () => {
input: undefined,
},
},
]);
];
mockExecuteFunctions.getInputData.mockReturnValueOnce(inputData);

mockExecuteFunctions.getNode.mockReturnValueOnce(mock<INode>({ typeVersion: 4.5 }));
mockExecuteFunctions.getNodeParameter
Expand Down Expand Up @@ -55,5 +56,6 @@ describe('Google Sheet - Append', () => {
range: 'Sheet1',
valueInputMode: 'USER_ENTERED',
});
expect(inputData[0].json).toEqual({ row_number: 3, name: 'NEW NAME', text: 'NEW TEXT' });
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,9 @@ export async function autoMapInputData(
}
});
if (item.json[ROW_NUMBER]) {
delete item.json[ROW_NUMBER];
const { [ROW_NUMBER]: _, ...json } = item.json;
returnData.push(json);
return;
}
returnData.push(item.json);
});
Expand Down

0 comments on commit da5e4be

Please sign in to comment.