Fix proxy — use arrayBuffer to preserve multipart boundary, fix double /api/ in transcribe URL
This commit is contained in:
+2
-2
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user