From ac5a734b7e19fe9fd9deff43f03e65003c0648ca Mon Sep 17 00:00:00 2001 From: "bianc8.eth" <48656276+bianc8@users.noreply.github.com> Date: Fri, 29 Nov 2024 11:54:18 +0100 Subject: [PATCH] update db for requestedBy author --- src/app/frames/token/[address]/route.tsx | 11 +++++++---- src/utils/schemas/db.schema.ts | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/frames/token/[address]/route.tsx b/src/app/frames/token/[address]/route.tsx index a6abc6b..8afa35d 100644 --- a/src/app/frames/token/[address]/route.tsx +++ b/src/app/frames/token/[address]/route.tsx @@ -13,7 +13,6 @@ import { BackgroundImage } from "@/app/frames/components/background-image"; import { getTokenFromAddress } from "@/utils/db"; import { getAddress, isAddress } from "viem"; -import { getUserDataForFid } from "frames.js"; function truncate(text: string, max: number) { return text.slice(0, max - 1) + (text.length > max ? "..." : ""); @@ -32,7 +31,12 @@ const frameHandler = frames(async (ctx) => { if (!token) { throw new Error("Token not found"); } - const requestor = await getUserDataForFid({ fid: token.requestedBy }); + const requestor = JSON.parse(token.requestedBy) as { + fid: number; + username: string; + displayName: string; + profileImage: string; + }; return { image: ( { tokenTable.address), createdAt: text("created_at").default(sql`CURRENT_TIMESTAMP`), updatedAt: text("updated_at").default(sql`CURRENT_TIMESTAMP`), });