From ba8120ab385267e17b7bb8d044ce1060b87f63e3 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sun, 16 Nov 2025 07:09:38 +0000 Subject: [PATCH] Fix type casting in creators endpoint POST cgen-ab4e89e188a3492b82638b8c9fbc8e6f --- api/creators.ts | 4 ++-- api/devconnect-links.ts | 2 +- api/discord/register-commands.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/creators.ts b/api/creators.ts index 1488f8e1..28376a4f 100644 --- a/api/creators.ts +++ b/api/creators.ts @@ -119,7 +119,7 @@ export async function getCreatorByUsername(username: string) { export async function createCreatorProfile(req: Request, userId: string) { try { - const body = await req.json(); + const body = (await req.json()) as any; const { username, bio, @@ -164,7 +164,7 @@ export async function createCreatorProfile(req: Request, userId: string) { export async function updateCreatorProfile(req: Request, userId: string) { try { - const body = await req.json(); + const body = (await req.json()) as any; const { username, bio, diff --git a/api/devconnect-links.ts b/api/devconnect-links.ts index d3192384..482bc1b8 100644 --- a/api/devconnect-links.ts +++ b/api/devconnect-links.ts @@ -7,7 +7,7 @@ const supabase = createClient(supabaseUrl, supabaseServiceRole); export async function linkDevConnectAccount(req: Request, userId: string) { try { - const body = await req.json(); + const body = (await req.json()) as { devconnect_username?: string; devconnect_profile_url?: string }; const { devconnect_username, devconnect_profile_url } = body; if (!devconnect_username) { diff --git a/api/discord/register-commands.ts b/api/discord/register-commands.ts index 9048e09e..ed4841aa 100644 --- a/api/discord/register-commands.ts +++ b/api/discord/register-commands.ts @@ -87,7 +87,7 @@ export default async function handler(req: VercelRequest, res: VercelResponse) { ); if (!response.ok) { - const errorData = await response.json(); + const errorData = (await response.json()) as any; console.error("[Discord] Registration error:", errorData); return res.status(response.status).json({ error: "Failed to register commands", @@ -95,7 +95,7 @@ export default async function handler(req: VercelRequest, res: VercelResponse) { }); } - const data = await response.json(); + const data = (await response.json()) as any[]; console.log("[Discord] Successfully registered commands:", data); return res.status(200).json({