code-gov-web icon indicating copy to clipboard operation
code-gov-web copied to clipboard

Search does not work without api_key

Open froi opened this issue 7 years ago • 0 comments

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)

  1. Have a local instance of code-gov-api running.
  2. Delete api key from code-gov-web config
  3. Set API URL to be localhost
  4. Run project
  5. Access project in any browser and execute a search
  6. 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.

froi avatar Aug 13 '18 05:08 froi