2
0
Files
bot/packages/bot-engine/queries/createSession.ts
2024-04-06 15:08:57 +02:00

20 lines
358 B
TypeScript

import prisma from '@typebot.io/lib/prisma'
import { Prisma } from '@typebot.io/prisma'
import { SessionState } from '@typebot.io/schemas'
type Props = {
id?: string
state: SessionState
}
export const createSession = ({
id,
state,
}: Props): Prisma.PrismaPromise<any> =>
prisma.chatSession.create({
data: {
id,
state,
},
})