[PNP-10040] Migrate /api/search/autocomplete endpoint from finder-frontend#5518
Draft
KludgeKML wants to merge 4 commits into
Draft
[PNP-10040] Migrate /api/search/autocomplete endpoint from finder-frontend#5518KludgeKML wants to merge 4 commits into
KludgeKML wants to merge 4 commits into
Conversation
- Rack::Cors is needed for the current requirement that the autocomplete API be accessible from any gov.uk domain and also heroku apps.
- This path is a wrapper around a call to the search_api_v2 autocomplete endpoint, but requires CORS support (and most of the test suite is CORS related) because it's currently required to be accessible from all true .gov.uk hosts (including non-prod) as well as heroku preview apps. Audit trail: https://github.com/alphagov/finder-frontend/blob/ddb7cd2c04a4f3d564cf11fb86393e75678add00/app/controllers/api/autocompletes_controller.rb https://github.com/alphagov/finder-frontend/blob/ddb7cd2c04a4f3d564cf11fb86393e75678add00/config/routes.rb#L13-L15 https://github.com/alphagov/finder-frontend/blob/ddb7cd2c04a4f3d564cf11fb86393e75678add00/config/initializers/cors.rb https://github.com/alphagov/finder-frontend/blob/ddb7cd2c04a4f3d564cf11fb86393e75678add00/spec/requests/api/autocomplete_spec.rb
e9851a2 to
c4fbac9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Support /api/search/autocomplete endpoint in Frontend. This is largely a wrapper around a call to Search API v2 anyway, so it's quite lightweight.
Why
Jira card: https://gov-uk.atlassian.net/browse/PNP-10040
Visual changes
None