@@ -12,11 +12,26 @@ export const createSession = ({
|
||||
id,
|
||||
state,
|
||||
isReplying,
|
||||
}: Props): Prisma.PrismaPromise<any> =>
|
||||
prisma.chatSession.create({
|
||||
data: {
|
||||
}: Props): Prisma.PrismaPromise<any> => {
|
||||
if (!id) {
|
||||
return prisma.chatSession.create({
|
||||
data: {
|
||||
id,
|
||||
state,
|
||||
isReplying,
|
||||
},
|
||||
})
|
||||
}
|
||||
return prisma.chatSession.upsert({
|
||||
where: { id },
|
||||
update: {
|
||||
state,
|
||||
isReplying,
|
||||
},
|
||||
create: {
|
||||
id,
|
||||
state,
|
||||
isReplying,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user