completionId: cgen-2a2caf82b3ce4c748ad3672881fb75a7
cgen-2a2caf82b3ce4c748ad3672881fb75a7
This commit is contained in:
parent
e9fd001484
commit
925e408da3
1 changed files with 10 additions and 1 deletions
|
|
@ -164,6 +164,8 @@ export function AdminDiscordManagement() {
|
|||
return;
|
||||
}
|
||||
|
||||
console.log("[Discord] Registering commands with token...");
|
||||
|
||||
const response = await fetch("/api/discord/admin-register-commands", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
|
|
@ -172,11 +174,18 @@ export function AdminDiscordManagement() {
|
|||
},
|
||||
});
|
||||
|
||||
console.log("[Discord] Response status:", response.status);
|
||||
|
||||
// Read body only once
|
||||
const data = await response.json().catch(() => ({}));
|
||||
|
||||
console.log("[Discord] Response data:", data);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data?.error || "Failed to register commands");
|
||||
throw new Error(
|
||||
data?.error ||
|
||||
`Server error (${response.status}): Failed to register commands`,
|
||||
);
|
||||
}
|
||||
|
||||
setRegisterSuccess(
|
||||
|
|
|
|||
Loading…
Reference in a new issue