mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-21 18:55:16 +02:00
fix return type of getPodcastByChat handler
This commit is contained in:
parent
ce4bb7e1b7
commit
839453dc8d
2 changed files with 2 additions and 8 deletions
|
|
@ -289,7 +289,7 @@ async def stream_podcast(
|
|||
) from e
|
||||
|
||||
|
||||
@router.get("/podcasts/by-chat/{chat_id}", response_model=PodcastRead)
|
||||
@router.get("/podcasts/by-chat/{chat_id}", response_model=PodcastRead | None)
|
||||
async def get_podcast_by_chat_id(
|
||||
chat_id: int,
|
||||
session: AsyncSession = Depends(get_async_session),
|
||||
|
|
@ -304,12 +304,6 @@ async def get_podcast_by_chat_id(
|
|||
)
|
||||
podcast = result.scalars().first()
|
||||
|
||||
if not podcast:
|
||||
raise HTTPException(
|
||||
status_code=404,
|
||||
detail="Podcast not found or you don't have permission to access it",
|
||||
)
|
||||
|
||||
return podcast
|
||||
except HTTPException as he:
|
||||
raise he
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ export function usePodcast() {
|
|||
throw new Error(errorData.detail || "Failed to fetch podcast");
|
||||
}
|
||||
|
||||
return (await response.json()) as PodcastItem;
|
||||
return (await response.json()) as PodcastItem | null;
|
||||
} catch (err: any) {
|
||||
console.error("Error fetching podcast:", err);
|
||||
throw err;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue