code-gov-web
code-gov-web copied to clipboard
Search does not work without api_key
Expected Behavior
Project should be able to consume an API without the api_key
Current Behavior
App is adding the api_key to the URL even though no api_key is specified. This makes the API return a 400 Bad Request. The api_key is a functionality that is not managed by the API.
Possible Solution
Set conditionals in the client.services.ts file to verify that the KEY variable is present / has value before concatenating the api_key query parameter.
Steps to Reproduce (for bugs)
- Have a local instance of code-gov-api running.
- Delete api key from code-gov-web config
- Set API URL to be localhost
- Run project
- Access project in any browser and execute a search
- Results should be empty
Context
Not being able to run this using a local instance without the need for an API key can/will hurt and person trying to test the project.