From bbc717abdaf583e174fab804dfed10badb79f09c Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sun, 16 Nov 2025 07:08:36 +0000 Subject: [PATCH] Fix type casting in admin register commands cgen-281568370d5a4af6be6d5c043658f1c3 --- api/discord/admin-register-commands.ts | 4 ++-- api/integrations/fourthwall.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/discord/admin-register-commands.ts b/api/discord/admin-register-commands.ts index a4bae3ea..3336adea 100644 --- a/api/discord/admin-register-commands.ts +++ b/api/discord/admin-register-commands.ts @@ -101,7 +101,7 @@ export default async function handler(req: VercelRequest, res: VercelResponse) { ); if (bulkResponse.ok) { - const data = await bulkResponse.json(); + const data = (await bulkResponse.json()) as any[]; console.log(`✅ Successfully registered ${data.length} slash commands`); return res.status(200).json({ @@ -112,7 +112,7 @@ export default async function handler(req: VercelRequest, res: VercelResponse) { } // If bulk update failed, try individual registration - const errorData = await bulkResponse.json(); + const errorData = (await bulkResponse.json()) as any; const errorCode = errorData?.code; if (errorCode === 50240) { diff --git a/api/integrations/fourthwall.ts b/api/integrations/fourthwall.ts index 86e5a618..c8988479 100644 --- a/api/integrations/fourthwall.ts +++ b/api/integrations/fourthwall.ts @@ -52,7 +52,7 @@ async function getFourthwallToken(): Promise { throw new Error(`Fourthwall auth failed: ${response.statusText}`); } - const data: FourthwallAuthResponse = await response.json(); + const data = (await response.json()) as FourthwallAuthResponse; return data.token; } catch (error) { console.error("[Fourthwall] Auth error:", error); @@ -103,7 +103,7 @@ async function handleGetProducts(req: any, res: any) { throw new Error(`Failed to fetch products: ${response.statusText}`); } - const data = await response.json(); + const data = (await response.json()) as { products?: unknown }; return res.status(200).json({ success: true,