From ec8dadae5cb86229ff4d5ff96bb2b54f9be2ffdf Mon Sep 17 00:00:00 2001 From: jsapro <77.3.77@mail.ru> Date: Tue, 19 Dec 2023 11:10:21 +0300 Subject: [PATCH] fix: fix deploy errors --- .../profile-order-mobile/index.tsx | 1 + .../profile-order/index.tsx | 5 +++ src/pages/profile/profile-orders/index.tsx | 39 ++++++++++++++++++- 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/components/profile-components/profile-order-mobile/index.tsx b/src/components/profile-components/profile-order-mobile/index.tsx index 42f327ae..ddf2a7a2 100644 --- a/src/components/profile-components/profile-order-mobile/index.tsx +++ b/src/components/profile-components/profile-order-mobile/index.tsx @@ -28,6 +28,7 @@ type Product = { }; type CommonOrder = { + id: number; order_number?: string; ordering_date?: string; total_price?: string; diff --git a/src/components/profile-components/profile-order/index.tsx b/src/components/profile-components/profile-order/index.tsx index 733633dc..4e264a90 100644 --- a/src/components/profile-components/profile-order/index.tsx +++ b/src/components/profile-components/profile-order/index.tsx @@ -19,9 +19,14 @@ type Product = { name: string; quantity: string; photo: string; + category: { + category_name: string; + category_slug: string; + }; }; type CommonOrder = { + id: number; order_number?: string; ordering_date?: string; total_price?: string; diff --git a/src/pages/profile/profile-orders/index.tsx b/src/pages/profile/profile-orders/index.tsx index 5e2ae320..cc903b77 100644 --- a/src/pages/profile/profile-orders/index.tsx +++ b/src/pages/profile/profile-orders/index.tsx @@ -5,11 +5,46 @@ import ReturnBackButton from '@components/profile-components/return-back-button' import { useProfile } from '@hooks/use-profile'; import styles from './profile-orders.module.scss'; import api from '@services/api'; -import { OrderList } from '@services/generated-api/data-contracts.ts'; +// import type { Product } from '@services/generated-api/data-contracts'; +// import { OrderList } from '@services/generated-api/data-contracts.ts'; + +type OrderStatusType = + | 'Ordered' + | 'In processing' + | 'Collecting' + | 'Gathered' + | 'In delivering' + | 'Delivered' + | 'Completed'; + +type Product = { + amount: number; + final_price: number; + id: number; + measure_unit: string; + name: string; + quantity: string; + photo: string; + category: { + category_name: string; + category_slug: string; + }; +}; + +type CommonOrder = { + id: number; + order_number?: string; + ordering_date?: string; + total_price?: string; + payment_method?: string; + delivery_method?: string; + status?: OrderStatusType; + products: Array<{ product: Product; quantity: string }> | Product[]; +}; export default function ProfileOrders() { const [isOpenDetails, setIsOpenDetails] = useState(); - const [orders, setOrders] = useState([]); + const [orders, setOrders] = useState([]); const { isMobileScreen } = useProfile(); useEffect(() => {