From 9c2304361f829a8f0a28460ea8f14bebd00b2939 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Fri, 28 Apr 2023 14:43:19 +0700
Subject: category

---
 src/lib/category/components/Category.jsx | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'src/lib/category/components/Category.jsx')

diff --git a/src/lib/category/components/Category.jsx b/src/lib/category/components/Category.jsx
index 9f34362c..eddedd24 100644
--- a/src/lib/category/components/Category.jsx
+++ b/src/lib/category/components/Category.jsx
@@ -1,6 +1,7 @@
 import odooApi from '@/core/api/odooApi'
 import Link from '@/core/components/elements/Link/Link'
 import DesktopView from '@/core/components/views/DesktopView'
+import { createSlug } from '@/core/utils/slug'
 import { useEffect, useState } from 'react'
 
 const Category = () => {
@@ -32,7 +33,7 @@ const Category = () => {
         {categories.map((category) => (
           <div key={category.id}>
             <Link
-              href={`/shop/search?category=${category.name}`}
+              href={createSlug('/shop/category/', category.name, category.id)}
               className='category-mega-box__parent'
             >
               {category.name}
@@ -42,7 +43,7 @@ const Category = () => {
                 {category.childs.map((child1Category) => (
                   <div key={child1Category.id}>
                     <Link
-                      href={`/shop/search?category=${child1Category.name}`}
+                      href={createSlug('/shop/category/', child1Category.name, child1Category.id)}
                       className='category-mega-box__child-one mb-4'
                     >
                       {child1Category.name}
@@ -50,7 +51,7 @@ const Category = () => {
                     <div className='flex flex-col gap-y-3'>
                       {child1Category.childs.map((child2Category) => (
                         <Link
-                          href={`/shop/search?category=${child2Category.name}`}
+                        href={createSlug('/shop/category/', child2Category.name, child2Category.id)}
                           className='category-mega-box__child-two'
                           key={child2Category.id}
                         >
-- 
cgit v1.2.3

