diff --git a/pages/search.tsx b/pages/search.tsx
index fbd8f9537..40bc3ecf7 100644
--- a/pages/search.tsx
+++ b/pages/search.tsx
@@ -42,7 +42,9 @@ export default function Home({
-
- All Categories
+
+ All Categories
+
{categories.map((cat) => (
-
-
- All Designers
+
+ All Designers
+
{brands.flatMap(({ node }) => (
- path.replace(/^\/|\/$/g, '')
-const getCategoryPath = (slug: string, designer?: string) =>
- designer ? `/search/designers/${designer}/${slug}` : `/search/${slug}`
+const getCategoryPath = (slug: string, brand?: string) =>
+ `/search${brand ? `/designers/${brand}` : ''}${slug ? `/${slug}` : ''}`
const getDesignerPath = (slug: string, category?: string) => {
const designer = slug.replace(/^brands/, 'designers')
- return `/search/${designer}${category ? `/${category}` : ''}`
+
+ return `/search${designer ? `/${designer}` : ''}${
+ category ? `/${category}` : ''
+ }`
}