fix: ReportsPage read scans list from results key - #389
Open
rathnakaragn wants to merge 1 commit into
Open
Conversation
The Reports page listed nothing for completed scans because it read the paginated scans response as data.scans, but the /api/scans/ envelope uses 'results' (as ScansPage already does). Read data.results so completed scans appear and CSV/PDF export is reachable from the Reports page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Reports page (
/reports) always showed "No completed scans to report on" even when completed scans existed.GET /api/scans/returned them correctly, but the page never rendered any row — so CSV/PDF export was unreachable from the Reports page entirely.Cause
ReportsPage.jsxread the paginated scans response asdata?.scans, but the/api/scans/envelope keys the list underresults({results, total, page, total_pages, ...}).ScansPage.jsxalready readsdata?.results— Reports was simply reading the wrong key, soscanswas always[].Fix
Verification
Reproduced against a completed scan and verified end-to-end in the browser after the fix:
GET /reports/<uuid>/csv/→ HTTP 200 (content verified).GET /reports/<uuid>/pdf/→ HTTP 200, valid PDF downloaded.Notes
frontend/dist/) is gitignored and rebuilt by CI/Docker, so nothing else to commit.🤖 Generated with Claude Code
https://claude.ai/code/session_01WRGejrw65nttnhupK7A7wv