summaryrefslogtreecommitdiff
path: root/src/lib/category/components
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-04-28 14:43:19 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-04-28 14:43:19 +0700
commit9c2304361f829a8f0a28460ea8f14bebd00b2939 (patch)
treea185a7f089f491a4f1470d1b843653434c166eb4 /src/lib/category/components
parentbfd9e65575eca673573429eb75a5ab3c21f53459 (diff)
category
Diffstat (limited to 'src/lib/category/components')
-rw-r--r--src/lib/category/components/Category.jsx7
1 files changed, 4 insertions, 3 deletions
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}
>