2023-09-20 15:26:52 +02:00
|
|
|
import prisma from '@typebot.io/lib/prisma'
|
2023-07-18 14:31:20 +02:00
|
|
|
import { SessionState } from '@typebot.io/schemas'
|
|
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
id: string
|
|
|
|
|
state: SessionState
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const updateSession = async ({ id, state }: Props) =>
|
|
|
|
|
prisma.chatSession.updateMany({
|
|
|
|
|
where: { id },
|
|
|
|
|
data: {
|
|
|
|
|
state,
|
|
|
|
|
},
|
|
|
|
|
})
|