Skip to content

Fix: File downloads and opens used wrong API URL#471

Open
amahuli03 wants to merge 2 commits intoCodeForPhilly:developfrom
amahuli03:file-download-error
Open

Fix: File downloads and opens used wrong API URL#471
amahuli03 wants to merge 2 commits intoCodeForPhilly:developfrom
amahuli03:file-download-error

Conversation

@amahuli03
Copy link
Collaborator

Description

I fixed the API URL path in handleDownload in ListOfFiles.tsx. It was missing the /api prefix specified in balancer_backend/urls.py, so file downloads were resulting in 400 error.

While looking into this error I also found that handleOpen in ListOfFiles.tsx used the same wrong URL. handleOpen is called from the Help/DataSources page and, as expected, was resulting in 400 errors when I tried to view the files. The same fix as handleDownload fixed this issue, and this View button acts as expected now.

Related Issue

https://codeforphilly.slack.com/archives/C059A5JHX8X/p1772128435712889

Manual Tests

Locally tested file downloads, which now successfully download the real PDF.
Locally tested file opens from the Help/DataSources page, which now successfully open the PDF in a new tab.

Reviewers

@sahilds1

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