From ab9e36f68d5458398af2d4bae0a82d00303a4de4 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Wed, 22 May 2024 14:59:24 +0200 Subject: [PATCH] :monocle_face: Improve chat session inspection script --- packages/scripts/inspectChatSession.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/scripts/inspectChatSession.ts b/packages/scripts/inspectChatSession.ts index 7c8327894..6c988517f 100644 --- a/packages/scripts/inspectChatSession.ts +++ b/packages/scripts/inspectChatSession.ts @@ -22,6 +22,9 @@ const inspectChatSession = async () => { where: { id, }, + select: { + state: true, + }, }) if (!chatSession) { @@ -29,7 +32,15 @@ const inspectChatSession = async () => { return } - console.log(JSON.stringify(chatSession, null, 2)) + const result = await prisma.result.findFirst({ + where: { + id: (chatSession.state as any).typebotsQueue[0].resultId, + }, + }) + + console.log({ + result, + }) } inspectChatSession()