@@ -19,13 +19,11 @@ export const getRow = async (
|
||||
}: { outgoingEdgeId?: string; options: GoogleSheetsGetOptions }
|
||||
): Promise<ExecuteIntegrationResponse> => {
|
||||
const logs: ReplyLog[] = []
|
||||
const { sheetId, cellsToExtract, referenceCell, filter } = deepParseVariables(
|
||||
state.typebot.variables
|
||||
)(options)
|
||||
const { variables } = state.typebotsQueue[0].typebot
|
||||
const { sheetId, cellsToExtract, referenceCell, filter } =
|
||||
deepParseVariables(variables)(options)
|
||||
if (!sheetId) return { outgoingEdgeId }
|
||||
|
||||
const variables = state.typebot.variables
|
||||
|
||||
const doc = await getAuthenticatedGoogleDoc({
|
||||
credentialsId: options.credentialsId,
|
||||
spreadsheetId: options.spreadsheetId,
|
||||
|
||||
@@ -8,12 +8,13 @@ import { getAuthenticatedGoogleDoc } from './helpers/getAuthenticatedGoogleDoc'
|
||||
import { ExecuteIntegrationResponse } from '@/features/chat/types'
|
||||
|
||||
export const insertRow = async (
|
||||
{ typebot: { variables } }: SessionState,
|
||||
state: SessionState,
|
||||
{
|
||||
outgoingEdgeId,
|
||||
options,
|
||||
}: { outgoingEdgeId?: string; options: GoogleSheetsInsertRowOptions }
|
||||
): Promise<ExecuteIntegrationResponse> => {
|
||||
const { variables } = state.typebotsQueue[0].typebot
|
||||
if (!options.cellsToInsert || !options.sheetId) return { outgoingEdgeId }
|
||||
|
||||
const logs: ReplyLog[] = []
|
||||
|
||||
@@ -10,12 +10,13 @@ import { ExecuteIntegrationResponse } from '@/features/chat/types'
|
||||
import { matchFilter } from './helpers/matchFilter'
|
||||
|
||||
export const updateRow = async (
|
||||
{ typebot: { variables } }: SessionState,
|
||||
state: SessionState,
|
||||
{
|
||||
outgoingEdgeId,
|
||||
options,
|
||||
}: { outgoingEdgeId?: string; options: GoogleSheetsUpdateRowOptions }
|
||||
): Promise<ExecuteIntegrationResponse> => {
|
||||
const { variables } = state.typebotsQueue[0].typebot
|
||||
const { sheetId, referenceCell, filter } =
|
||||
deepParseVariables(variables)(options)
|
||||
if (!options.cellsToUpsert || !sheetId || (!referenceCell && !filter))
|
||||
|
||||
Reference in New Issue
Block a user