2.0 KiB
Shot Endpoint Fix - Browser Cache Issue
Problem
After updating the shot service endpoints, the browser shows "Request failed with status code 404" when trying to load shots. The backend logs show requests to /projects/1/shots?episode_id=2, which is the old endpoint.
Root Cause
The browser has cached the old JavaScript bundle that contains the old API endpoints. Even though the source code has been updated, the browser is still using the cached version.
Solution
Hard refresh the browser to clear the cache and load the new JavaScript bundle:
Windows/Linux
- Press
Ctrl + Shift + R - OR Press
Ctrl + F5
Mac
- Press
Cmd + Shift + R
Alternative Method (All Platforms)
- Open browser DevTools (F12)
- Right-click the refresh button in the browser toolbar
- Select "Empty Cache and Hard Reload"
Verification
After hard refreshing, the browser should:
- Load shots successfully
- Backend logs should show requests to
/shots?episode_id=X(new endpoint) - No more 404 errors
Technical Details
Updated Endpoints
The shot service has been updated to use the correct backend routes:
Old (incorrect):
- GET
/projects/{projectId}/shots?episode_id={episodeId} - GET
/projects/{projectId}/shots/{shotId} - POST
/projects/{projectId}/episodes/{episodeId}/shots - PUT
/projects/{projectId}/shots/{shotId} - DELETE
/projects/{projectId}/shots/{shotId}
New (correct):
- GET
/shots?episode_id={episodeId} - GET
/shots/{shotId} - POST
/shots?episode_id={episodeId} - PUT
/shots/{shotId} - DELETE
/shots/{shotId} - POST
/shots/bulk?episode_id={episodeId}(bulk creation)
Files Updated
frontend/src/services/shot.ts- All service methods updatedfrontend/src/components/shot/ShotBrowser.vue- All service calls updated
Backend Verification
The backend endpoints have been tested and are working correctly:
python backend/test_shots_endpoint.py
All tests pass, confirming the backend is ready for the new frontend code.