diff --git a/pages/search.tsx b/pages/search.tsx index 40bc3ecf7..7d29968aa 100644 --- a/pages/search.tsx +++ b/pages/search.tsx @@ -22,8 +22,10 @@ export default function Home({ brands, }: InferGetStaticPropsType) { const router = useRouter() - const { q } = router.query - const { category, brand } = useSearchMeta(router.asPath) + const { asPath } = router + const { q, sort } = router.query + const query = filterQuery({ q, sort }) + const { category, brand } = useSearchMeta(asPath) const activeCategory = categories.find( (cat) => getSlug(cat.path) === category ) @@ -42,7 +44,7 @@ export default function Home({