diff --git a/pages/search.tsx b/pages/search.tsx index 7d29968aa..ded6957b4 100644 --- a/pages/search.tsx +++ b/pages/search.tsx @@ -25,6 +25,8 @@ export default function Home({ const { asPath } = router const { q, sort } = router.query const query = filterQuery({ q, sort }) + const pathname = asPath.split('?')[0] + const { category, brand } = useSearchMeta(asPath) const activeCategory = categories.find( (cat) => getSlug(cat.path) === category @@ -32,6 +34,7 @@ export default function Home({ const activeBrand = brands.find( (b) => getSlug(b.node.path) === `brands/${brand}` )?.node + const { data } = useSearch({ search: typeof q === 'string' ? q : '', categoryId: activeCategory?.entityId, @@ -120,17 +123,53 @@ export default function Home({