2
0

Regroup database queries of /sendMessage in one place

Potentially reduces the total queries to database and it will help to migrate to Edge runtime
This commit is contained in:
Baptiste Arnaud
2023-07-18 14:31:20 +02:00
parent 1095cf7f09
commit aa4c16dad7
32 changed files with 520 additions and 482 deletions

View File

@@ -2,10 +2,10 @@ import { ExecuteLogicResponse } from '@/features/chat/types'
import { parseVariables } from '@/features/variables/parseVariables'
import { SessionState, WaitBlock } from '@typebot.io/schemas'
export const executeWait = async (
export const executeWait = (
{ typebot: { variables } }: SessionState,
block: WaitBlock
): Promise<ExecuteLogicResponse> => {
): ExecuteLogicResponse => {
if (!block.options.secondsToWaitFor)
return { outgoingEdgeId: block.outgoingEdgeId }
const parsedSecondsToWaitFor = safeParseInt(