diff --git a/frontend/src/components/searchField/SearchField.tsx b/frontend/src/components/searchField/SearchField.tsx index a352bc88c..ddeb1a946 100644 --- a/frontend/src/components/searchField/SearchField.tsx +++ b/frontend/src/components/searchField/SearchField.tsx @@ -212,7 +212,7 @@ const SearchField: FC = ({ const handleChange = (result: OnChangeValue) => { if (result?.type === "ALL") - return navigate(createHref(ROUTE_SEARCH, { term: searchTerm.current })); + return navigate(createHref(ROUTE_SEARCH, { "*": searchTerm.current })); if (result?.value) { if (valueIsPerformer(result.value)) onClickPerformer?.(result.value); @@ -225,7 +225,7 @@ const SearchField: FC = ({ const handleKeyDown = (e: KeyboardEvent) => { if (e.key === "Enter" && searchTerm.current && showAllLink) { - navigate(createHref(ROUTE_SEARCH, { term: searchTerm.current })); + navigate(createHref(ROUTE_SEARCH, { "*": searchTerm.current })); selectRef?.current?.blur(); } }; diff --git a/frontend/src/constants/route.ts b/frontend/src/constants/route.ts index 9ccf4df03..96d87881b 100644 --- a/frontend/src/constants/route.ts +++ b/frontend/src/constants/route.ts @@ -43,7 +43,7 @@ export const ROUTE_FORGOT_PASSWORD = "/forgot-password"; export const ROUTE_RESET_PASSWORD = "/reset-password"; export const ROUTE_CONFIRM_EMAIL = "/users/confirm-email"; export const ROUTE_CHANGE_EMAIL = "/users/change-email"; -export const ROUTE_SEARCH = "/search/:term"; +export const ROUTE_SEARCH = "/search/*"; export const ROUTE_SEARCH_INDEX = "/search/"; export const ROUTE_VERSION = "/version"; export const ROUTE_SITE = "/sites/:id"; diff --git a/frontend/src/pages/search/Search.tsx b/frontend/src/pages/search/Search.tsx index cf7e543c5..4ccf3466c 100644 --- a/frontend/src/pages/search/Search.tsx +++ b/frontend/src/pages/search/Search.tsx @@ -127,7 +127,7 @@ const SceneCard: FC<{ scene: Scene }> = ({ scene }) => ( ); const Search: FC = () => { - const { term } = useParams(); + const { "*": term } = useParams(); const navigate = useNavigate(); const { loading, data } = useSearchAll( { @@ -143,7 +143,7 @@ const Search: FC = () => { (searchTerm: string) => navigate( searchTerm - ? createHref(ROUTE_SEARCH, { term: searchTerm }) + ? createHref(ROUTE_SEARCH, { "*": searchTerm }) : ROUTE_SEARCH_INDEX, { replace: true }, ),