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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("[Discord] Registering commands with token...");
|
||||||
|
|
||||||
const response = await fetch("/api/discord/admin-register-commands", {
|
const response = await fetch("/api/discord/admin-register-commands", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
|
|
@ -172,11 +174,18 @@ export function AdminDiscordManagement() {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log("[Discord] Response status:", response.status);
|
||||||
|
|
||||||
// Read body only once
|
// Read body only once
|
||||||
const data = await response.json().catch(() => ({}));
|
const data = await response.json().catch(() => ({}));
|
||||||
|
|
||||||
|
console.log("[Discord] Response data:", data);
|
||||||
|
|
||||||
if (!response.ok) {
|
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(
|
setRegisterSuccess(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue