-
Notifications
You must be signed in to change notification settings - Fork 63
Redirect search pages to home when no search query is present #1474
Conversation
Storybook and Tailwind configuration previews: Ready Storybook: https://wordpress.github.io/openverse-frontend/1474 Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again. You can check the GitHub pages deployment action list to see the current status of the deployments. |
Size Change: +78 B (0%) Total Size: 1.44 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice that it was such a simple change :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an e2e test for the redirect? Otherwise it LGTM.
I've added a new e2e test file, @sarayourfriend |
Fixes
Fixes #596 by @obulat
Description
Adds an anonymous middleware to the root
/search
route so that any search path without a search query paremeter is redirected to the homepage.Testing Instructions
Visit
/search/
and all child routes without a query param and observe homepage redirection. You should not be redirected if there is a search term.Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin