summaryrefslogtreecommitdiff
path: root/src/lib/category
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/category')
-rw-r--r--src/lib/category/components/Category.jsx11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/category/components/Category.jsx b/src/lib/category/components/Category.jsx
index 9f34362c..884a871f 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,11 @@ 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}
>