@@ -1,14 +1,14 @@
|
||||
import { ConditionBlock, SessionState } from '@typebot.io/schemas'
|
||||
import { ExecuteLogicResponse } from '../../../types'
|
||||
import { executeCondition } from './executeCondition'
|
||||
|
||||
import { executeCondition } from '@typebot.io/logic/executeCondition'
|
||||
export const executeConditionBlock = (
|
||||
state: SessionState,
|
||||
block: ConditionBlock
|
||||
): ExecuteLogicResponse => {
|
||||
const { variables } = state.typebotsQueue[0].typebot
|
||||
const passedCondition = block.items.find(
|
||||
(item) => item.content && executeCondition(variables)(item.content)
|
||||
(item) =>
|
||||
item.content && executeCondition({ variables, condition: item.content })
|
||||
)
|
||||
return {
|
||||
outgoingEdgeId: passedCondition
|
||||
|
||||
Reference in New Issue
Block a user