Skip to content

Commit

Permalink
fix: fix deploy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jsapro committed Dec 19, 2023
1 parent 05b8fee commit ec8dada
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type Product = {
};

type CommonOrder = {
id: number;
order_number?: string;
ordering_date?: string;
total_price?: string;
Expand Down
5 changes: 5 additions & 0 deletions src/components/profile-components/profile-order/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
39 changes: 37 additions & 2 deletions src/pages/profile/profile-orders/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<number>();
const [orders, setOrders] = useState<OrderList[]>([]);
const [orders, setOrders] = useState<CommonOrder[]>([]);
const { isMobileScreen } = useProfile();

useEffect(() => {
Expand Down

0 comments on commit ec8dada

Please sign in to comment.