fix(voice): correct API URL path for voice command
- Change /voice/command to /api/voice/command - Nginx proxies /api/* routes; /voice/command returns 405 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
fc2bd3baf1
commit
3252b323d3
@@ -6,12 +6,13 @@ const SAMPLE_RATE = 24000;
|
|||||||
|
|
||||||
async function sendTransmitCommand(command: string): Promise<void> {
|
async function sendTransmitCommand(command: string): Promise<void> {
|
||||||
// Send via HTTP API
|
// Send via HTTP API
|
||||||
const resp = await fetch(`${getAPIURL()}/voice/command`, {
|
const resp = await fetch(`${getAPIURL()}/api/voice/command`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({ command }),
|
body: JSON.stringify({ command }),
|
||||||
});
|
});
|
||||||
if (!resp.ok) {
|
if (!resp.ok) {
|
||||||
|
console.warn("HTTP command response:", resp.status, resp.statusText);
|
||||||
const text = await resp.text().catch(() => resp.statusText);
|
const text = await resp.text().catch(() => resp.statusText);
|
||||||
console.warn("HTTP command failed:", text);
|
console.warn("HTTP command failed:", text);
|
||||||
throw new Error(`HTTP ${resp.status}: ${text}`);
|
throw new Error(`HTTP ${resp.status}: ${text}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user