Fix type casting in admin register commands
cgen-281568370d5a4af6be6d5c043658f1c3
This commit is contained in:
parent
1e1917800e
commit
bbc717abda
2 changed files with 4 additions and 4 deletions
|
|
@ -101,7 +101,7 @@ export default async function handler(req: VercelRequest, res: VercelResponse) {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (bulkResponse.ok) {
|
if (bulkResponse.ok) {
|
||||||
const data = await bulkResponse.json();
|
const data = (await bulkResponse.json()) as any[];
|
||||||
console.log(`✅ Successfully registered ${data.length} slash commands`);
|
console.log(`✅ Successfully registered ${data.length} slash commands`);
|
||||||
|
|
||||||
return res.status(200).json({
|
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
|
// If bulk update failed, try individual registration
|
||||||
const errorData = await bulkResponse.json();
|
const errorData = (await bulkResponse.json()) as any;
|
||||||
const errorCode = errorData?.code;
|
const errorCode = errorData?.code;
|
||||||
|
|
||||||
if (errorCode === 50240) {
|
if (errorCode === 50240) {
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ async function getFourthwallToken(): Promise<string> {
|
||||||
throw new Error(`Fourthwall auth failed: ${response.statusText}`);
|
throw new Error(`Fourthwall auth failed: ${response.statusText}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const data: FourthwallAuthResponse = await response.json();
|
const data = (await response.json()) as FourthwallAuthResponse;
|
||||||
return data.token;
|
return data.token;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("[Fourthwall] Auth error:", 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}`);
|
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({
|
return res.status(200).json({
|
||||||
success: true,
|
success: true,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue