From 13d09441ea2ce6ba46c48ce5eda9b61e006f3990 Mon Sep 17 00:00:00 2001 From: Bhavya Gor Date: Sun, 30 Jun 2024 20:13:58 +0530 Subject: [PATCH] commented analytics --- .../app/api/orchestrator/[frameId]/route.ts | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/nextjs/app/api/orchestrator/[frameId]/route.ts b/packages/nextjs/app/api/orchestrator/[frameId]/route.ts index 89e5fe9..7dd9a40 100644 --- a/packages/nextjs/app/api/orchestrator/[frameId]/route.ts +++ b/packages/nextjs/app/api/orchestrator/[frameId]/route.ts @@ -22,24 +22,26 @@ async function getResponse(req: NextRequest): Promise { const url = req.nextUrl.pathname; const frameId = url.replace(`/api/orchestrator`, ""); const body = await req.json(); - const state = JSON.parse(decodeURIComponent(body.untrustedData.state as string)); + console.log("body", body); + // const state = JSON.parse(decodeURIComponent(body.untrustedData.state as string)); // Creating Analytics for the frame asynchronously - storeAnalytics(body, state).catch(err => console.error("Error Saving Analytics", err)); + // storeAnalytics(body, state).catch(err => console.error("Error Saving Analytics", err)); // Adding State for Button Press and Inputted Text on last frame - const stateUpdate = { - ...state, - [`${frameId}ButtonPressed`]: body.untrustedData.buttonIndex, - [`${frameId}InputtedText`]: body.untrustedData.inputText, - }; + // const stateUpdate = { + // ...state, + // [`${frameId}ButtonPressed`]: body.untrustedData.buttonIndex, + // [`${frameId}InputtedText`]: body.untrustedData.inputText, + // }; const dbFrame = await getFrameAtServer(frameId); + console.log("dbFrame", dbFrame); if (!dbFrame) { return new NextResponse(JSON.stringify({ message: "Frame not found" }), { status: 404 }); } const nextFrame = dbFrame.frameJson; - nextFrame.state = { - ...stateUpdate, - }; + // nextFrame.state = { + // ...stateUpdate, + // }; return new NextResponse(getFrameHtmlResponse(nextFrame)); }