Fix proxy — use arrayBuffer to preserve multipart boundary, fix double /api/ in transcribe URL

This commit is contained in:
2026-04-26 11:32:13 -04:00
parent 5ce73c18c6
commit b696fd07a5
2 changed files with 17 additions and 7 deletions
+2 -2
View File
@@ -35,7 +35,7 @@ export const api = {
transcribe: async (audio: Blob): Promise<{ text: string }> => {
const form = new FormData();
form.append('audio', audio, 'recording.webm');
const url = API_BASE ? `${API_BASE}/api/transcribe` : '/api/api/transcribe';
const url = API_BASE ? `${API_BASE}/api/transcribe` : '/api/transcribe';
const res = await fetch(url, { method: 'POST', credentials: 'include', body: form });
if (!res.ok) throw new Error(`Transcribe error: ${res.status}`);
return res.json();
@@ -46,7 +46,7 @@ export const api = {
if (data.image) form.append('image', data.image);
if (data.text) form.append('text', data.text);
if (data.project) form.append('project', data.project);
const url = API_BASE ? `${API_BASE}/api/capture` : '/api/api/capture';
const url = API_BASE ? `${API_BASE}/api/capture` : '/api/capture';
const res = await fetch(url, { method: 'POST', credentials: 'include', body: form });
if (!res.ok) throw new Error(`Capture error: ${res.status}`);
return res.json();