-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Receipts endpoint throwing 400 bad request error in browser console #3006
Comments
Thanks @pkfec, this is something that I also noticed when lifting the 2 year restriction on the receipts datatable. To my knowledge, this table has the ability to switch between "Processed" vs "Raw" transactions. Because of this, the datatable seems to be initialized with the tableSwitcher logic to begin with, which seems to pass the 400 bad request to start. Then a redirect is applied to redirect to the default election year. This definitely needs to be refactored. |
thanks for looking into this issue @patphongs. We can tackle this is coming sprints based on the workload. |
Summary
Investigate
receipts
url below which is throwing a 400 bad request error in browser console. This error is reproducible on all 4 environments (feature/dev/stage/prod). Check why thetwo_year_transaction_period
is missing from one of the api call which is failing with a 400 bad request error.https://www.fec.gov/data/receipts/?data_type=processed&two_year_transaction_period=2020&min_date=01%2F01%2F2019&max_date=12%2F31%2F2020
How to Reproduce
Copy and Paste this URL in a browser: https://www.fec.gov/data/receipts/?data_type=processed&two_year_transaction_period=2020&min_date=01%2F01%2F2019&max_date=12%2F31%2F2020
Right click on the browser, select Inspect. Look in the Network tab:
There are 2 api calls:
First api call returns 400 bad request error (without two_year_transaction_period):
https://api.open.fec.gov/v1/schedules/schedule_a/?api_key=********&sort_hide_null=false&sort_nulls_last=false&data_type=processed&sort=-contribution_receipt_date&per_page=30 ** 400 (Bad Request)**
Second api call is successful and returns records:
https://api.open.fec.gov/v1/schedules/schedule_a/?api_key=*********&sort_hide_null=false&sort_nulls_last=false&data_type=processed&two_year_transaction_period=2020&min_date=01%2F01%2F2019&max_date=12%2F31%2F2020&sort=-contribution_receipt_date&per_page=30
Browser
Chrome or Firefox
Screenshots
The text was updated successfully, but these errors were encountered: