fecgov / fec-cms

The content management system (CMS) for the new Federal Election Commission website.
https://www.fec.gov
Other
91 stars 38 forks source link

Inaccurate regulations results count in search across legal resources #6282

Closed JonellaCulmer closed 3 weeks ago

JonellaCulmer commented 1 month ago

Summary

Small bug with the counts for regulations on the search across legal resources search results. https://www.fec.gov/data/legal/search/?search_type=regulations&search=105

Related Tickets

Screenshots

Screenshot 2024-06-02 at 10 53 09 PM

Completion criteria

johnnyporkchops commented 1 month ago

The api_caller is still searching our api regulations endpoint (which will be removed ) and that is where is gets its results["regulations_returned"] count that is currently used in the template for this tag.

Our api returns 3 results: https://api.open.fec.gov/v1/legal/search/?q=105&type=regulations&api_key=DEMO_KEY

The new regulations search using eCFR returns 2: https://www.ecfr.gov/api/search/v1/results?query=105&agency_slugs%5B%5D=federal-election-commission&date=current&per_page=3&page=1&order=relevance&paginate_by=results

--or-- https://www.fec.gov/data/legal/search/regulations/?search=105&search_type=regulations

Fix: We just need to remove the reference to regulations in api_caller and add results["regulations_returned"] to legal_search() in legal/views.py