Skip to content

Commit

Permalink
fix: default light theme & microservice error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sourabh-josh committed Sep 26, 2024
1 parent d748382 commit e492cca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
20 changes: 5 additions & 15 deletions app/src/app/api/transcribe/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,13 @@ export async function POST(req: Request) {
return new Response("Microservice URL not found", { status: 500 });
}

// const {data} = await axios.post(BASE_URL+'/upload-audio',{
// audio_file_link: documentUrl,
// })

const response = await fetch(BASE_URL + "/upload-audio", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
const {data,status:transcriptionStatus} = await axios.post(BASE_URL+'/upload-audio',{
audio_file_link: documentUrl,
}),
});


const data = await response.json();
})

if(transcriptionStatus !== 200){
return new Response("Internal server error", { status: 500 });
}

return new Response(JSON.stringify(data), { status: 200 });
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function RootLayout({
<TanstackQueryProvider>
<ThemeProvider
attribute="class"
defaultTheme="system"
defaultTheme="light"
enableSystem
disableTransitionOnChange
>
Expand Down

0 comments on commit e492cca

Please sign in to comment.