♻️ (viewer) Remove barrel exports and flatten folder arch
This commit is contained in:
12
apps/viewer/src/features/chat/helpers/getSessionState.ts
Normal file
12
apps/viewer/src/features/chat/helpers/getSessionState.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import prisma from '@/lib/prisma'
|
||||
import { ChatSession } from '@typebot.io/schemas'
|
||||
|
||||
export const getSession = async (
|
||||
sessionId: string
|
||||
): Promise<Pick<ChatSession, 'state' | 'id'> | null> => {
|
||||
const session = (await prisma.chatSession.findUnique({
|
||||
where: { id: sessionId },
|
||||
select: { id: true, state: true },
|
||||
})) as Pick<ChatSession, 'state' | 'id'> | null
|
||||
return session
|
||||
}
|
||||
Reference in New Issue
Block a user