File tree Expand file tree Collapse file tree 2 files changed +2
-8
lines changed
surfsense_backend/app/routes Expand file tree Collapse file tree 2 files changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -290,7 +290,7 @@ def iterfile():
290290 ) from e
291291
292292
293- @router .get ("/podcasts/by-chat/{chat_id}" , response_model = PodcastRead )
293+ @router .get ("/podcasts/by-chat/{chat_id}" , response_model = PodcastRead | None )
294294async def get_podcast_by_chat_id (
295295 chat_id : int ,
296296 session : AsyncSession = Depends (get_async_session ),
@@ -305,12 +305,6 @@ async def get_podcast_by_chat_id(
305305 )
306306 podcast = result .scalars ().first ()
307307
308- if not podcast :
309- raise HTTPException (
310- status_code = 404 ,
311- detail = "Podcast not found or you don't have permission to access it" ,
312- )
313-
314308 return podcast
315309 except HTTPException as he :
316310 raise he
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ export function usePodcast() {
1919 throw new Error ( errorData . detail || "Failed to fetch podcast" ) ;
2020 }
2121
22- return ( await response . json ( ) ) as PodcastItem ;
22+ return ( await response . json ( ) ) as PodcastItem | null ;
2323 } catch ( err : any ) {
2424 console . error ( "Error fetching podcast:" , err ) ;
2525 throw err ;
You can’t perform that action at this time.
0 commit comments