Fix type casting in admin register commands

cgen-281568370d5a4af6be6d5c043658f1c3
This commit is contained in:
Builder.io 2025-11-16 07:08:36 +00:00
parent 1e1917800e
commit bbc717abda
2 changed files with 4 additions and 4 deletions

View file

@ -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) {

View file

@ -52,7 +52,7 @@ async function getFourthwallToken(): Promise<string> {
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,