From 70a7054d4106576bfc2f6cdb496accab532ae5ad Mon Sep 17 00:00:00 2001 From: Kseniya Date: Mon, 13 May 2024 12:24:20 +0300 Subject: [PATCH] bugs and change Category types --- src/entities/Category/types/types.ts | 2 +- src/entities/CategoryCard/CategoryCard.stories.tsx | 2 +- src/entities/CategoryCard/CategoryCard.tsx | 2 +- src/shared/model/types/CategoryModel.ts | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/entities/Category/types/types.ts b/src/entities/Category/types/types.ts index fd8605e2..068f20d3 100644 --- a/src/entities/Category/types/types.ts +++ b/src/entities/Category/types/types.ts @@ -10,7 +10,7 @@ export interface Category { name: string slug: string branches?: Category[] - root?: Category + root?: string is_prohibited?: boolean is_visible_on_main?: boolean image?: string diff --git a/src/entities/CategoryCard/CategoryCard.stories.tsx b/src/entities/CategoryCard/CategoryCard.stories.tsx index f34d4eb5..6db93ec2 100644 --- a/src/entities/CategoryCard/CategoryCard.stories.tsx +++ b/src/entities/CategoryCard/CategoryCard.stories.tsx @@ -1,6 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react' -import { TCategory } from '@/models/CategoryModel' +import { TCategory } from '@/shared/model/types/CategoryModel' import card1 from '../../assets/images/categoryCards/img-categories-01-210x263.webp' diff --git a/src/entities/CategoryCard/CategoryCard.tsx b/src/entities/CategoryCard/CategoryCard.tsx index cbf2c2f4..acfca18d 100644 --- a/src/entities/CategoryCard/CategoryCard.tsx +++ b/src/entities/CategoryCard/CategoryCard.tsx @@ -1,9 +1,9 @@ import { FC } from 'react' +import { TCategory } from '@/shared/model/types/CategoryModel' import Paragraph from '@/shared/ui/Paragraph/Paragraph' import card1 from '../../assets/images/categoryCards/placeholder-1200x800.png' -import { TCategory } from '../../models/CategoryModel' import styles from './CategoryCard.module.scss' diff --git a/src/shared/model/types/CategoryModel.ts b/src/shared/model/types/CategoryModel.ts index a4037d53..7826764c 100644 --- a/src/shared/model/types/CategoryModel.ts +++ b/src/shared/model/types/CategoryModel.ts @@ -1,9 +1,9 @@ export type TCategory = { - id: number + id?: number name: string slug: string branches?: TCategory[] - root?: string + root?: string | undefined is_prohibited?: boolean is_visible_on_main?: boolean image?: string | null