2
0

(variables) Add session option in variables (#1490)

Closes #1488
This commit is contained in:
Baptiste Arnaud
2024-05-02 15:11:16 +02:00
committed by GitHub
parent 87653f8e10
commit b4ae098440
20 changed files with 156 additions and 82 deletions

View File

@ -1,7 +1,7 @@
import prisma from '@typebot.io/lib/prisma'
import { Prisma } from '@typebot.io/prisma'
import { TypebotInSession } from '@typebot.io/schemas'
import { filterVariablesWithValues } from '@typebot.io/variables/filterVariablesWithValues'
import { filterNonSessionVariablesWithValues } from '@typebot.io/variables/filterVariablesWithValues'
type Props = {
resultId: string
@ -15,7 +15,9 @@ export const upsertResult = ({
hasStarted,
isCompleted,
}: Props): Prisma.PrismaPromise<any> => {
const variablesWithValue = filterVariablesWithValues(typebot.variables)
const variablesWithValue = filterNonSessionVariablesWithValues(
typebot.variables
)
return prisma.result.upsert({
where: { id: resultId },
update: {