🐛 (sheets) Make sure update cells do not overwrite existing…

This commit is contained in:
Baptiste Arnaud
2024-06-27 11:25:43 +02:00
parent 898ed529b0
commit 1431898b82
5 changed files with 41 additions and 10 deletions

View File

@@ -0,0 +1,14 @@
import { Variable, Cell } from '@typebot.io/schemas'
import { parseVariables } from '@typebot.io/variables/parseVariables'
export const parseNewRowObject =
(variables: Variable[]) =>
(cells: Cell[]): { [key: string]: string } =>
cells.reduce((row, cell) => {
return !cell.column || !cell.value
? row
: {
...row,
[cell.column]: parseVariables(variables)(cell.value),
}
}, {})