diff --git a/apps/builder/app/routes/rest.ai.audio.transcriptions.ts b/apps/builder/app/routes/rest.ai.audio.transcriptions.ts index a1b181ae1b..6fc5b00314 100644 --- a/apps/builder/app/routes/rest.ai.audio.transcriptions.ts +++ b/apps/builder/app/routes/rest.ai.audio.transcriptions.ts @@ -18,24 +18,25 @@ export const action = async ({ request }: ActionArgs) => { ); if (response.ok === false) { - const txt = await response.text(); + const message = await response.text(); // eslint-disable-next-line no-console - console.error("ERROR", response.status, txt); + console.error("ERROR", response.status, message); return { success: false, error: { status: response.status, - message: txt, + message, }, }; } + // @todo untyped const data = await response.json(); return { success: true, - text: data.text, + text: data.text.trim(), }; };