Skip to content

Fix: use correct API route for audio requests#636

Open
iprasannamb wants to merge 6 commits intoKathiraveluLab:devfrom
iprasannamb:fix/ae
Open

Fix: use correct API route for audio requests#636
iprasannamb wants to merge 6 commits intoKathiraveluLab:devfrom
iprasannamb:fix/ae

Conversation

@iprasannamb
Copy link
Copy Markdown
Contributor

Summary

Problem

  • Secure audio requests were sent to an incorrect endpoint (/audio/:filename instead of /api/audio/:filename)
  • Admin audio download used a non-API route for audio files.
  • On fetch failure, the component did not transition to an error UI.

Changes

  • Updated protected audio fetch endpoint from /audio/:filename to /api/audio/:filename in ProtectedRoutes component.
  • Added state reset before each fetch attempt to avoid stale UI.

Checklist:

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the audio fetching logic to use the /api/audio/ endpoint and introduces error handling and state management for the ProtectedAudio component. Feedback focuses on preventing memory leaks in useEffect by using a cancellation flag and ensuring that filenames are properly encoded when constructing API endpoints to handle special characters.

@iprasannamb
Copy link
Copy Markdown
Contributor Author

@pradeeban , Could you please review this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant