"feat: enhance order management with new APIs and schema changes"
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
// src/pages/dashboard/order/details.tsx
|
||||
import { useParams } from 'src/routes/hooks';
|
||||
|
||||
import { _orders } from 'src/_mock/_order';
|
||||
import { CONFIG } from 'src/global-config';
|
||||
import { useGetOrder } from 'src/actions/order';
|
||||
|
||||
import { OrderDetailsView } from 'src/sections/order/view';
|
||||
|
||||
@@ -12,13 +14,18 @@ const metadata = { title: `Order details | Dashboard - ${CONFIG.appName}` };
|
||||
export default function Page() {
|
||||
const { id = '' } = useParams();
|
||||
|
||||
const currentOrder = _orders.find((order) => order.id === id);
|
||||
// const currentOrder = _orders.find((order) => order.id === id);
|
||||
// TODO: error handling
|
||||
const { order, orderLoading, orderError } = useGetOrder(id);
|
||||
|
||||
if (!order) return <>loading</>;
|
||||
if (orderLoading) return <>loading</>;
|
||||
|
||||
return (
|
||||
<>
|
||||
<title>{metadata.title}</title>
|
||||
|
||||
<OrderDetailsView order={currentOrder} />
|
||||
<OrderDetailsView order={order} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
// src/pages/dashboard/product/details.tsx
|
||||
|
||||
import { useParams } from 'src/routes/hooks';
|
||||
|
||||
import { CONFIG } from 'src/global-config';
|
||||
|
Reference in New Issue
Block a user