2
0

Remove empty strings from variable parsing when possible

This commit is contained in:
Baptiste Arnaud
2024-04-18 10:17:25 +02:00
parent fb847e17dd
commit 3ca1a2f0d6
7 changed files with 34 additions and 17 deletions

View File

@ -8,9 +8,11 @@ export const parseDateInput =
const variables = state.typebotsQueue[0].typebot.variables
if (!block.options) return deepParseVariables(variables)(block)
return {
...deepParseVariables(variables)(block),
...block,
options: {
...deepParseVariables(variables)(block.options),
...deepParseVariables(variables, { removeEmptyStrings: true })(
block.options
),
min: parseDateLimit(
block.options.min,
block.options.hasTime,

View File

@ -21,7 +21,7 @@ export const getRow = async (
const logs: ChatLog[] = []
const { variables } = state.typebotsQueue[0].typebot
const { sheetId, cellsToExtract, filter, ...parsedOptions } =
deepParseVariables(variables)(options)
deepParseVariables(variables, { removeEmptyStrings: true })(options)
if (!sheetId) return { outgoingEdgeId }
const doc = await getAuthenticatedGoogleDoc({

View File

@ -17,8 +17,9 @@ export const updateRow = async (
}: { outgoingEdgeId?: string; options: GoogleSheetsUpdateRowOptions }
): Promise<ExecuteIntegrationResponse> => {
const { variables } = state.typebotsQueue[0].typebot
const { sheetId, filter, ...parsedOptions } =
deepParseVariables(variables)(options)
const { sheetId, filter, ...parsedOptions } = deepParseVariables(variables, {
removeEmptyStrings: true,
})(options)
const referenceCell =
'referenceCell' in parsedOptions && parsedOptions.referenceCell