"feat: enhance order management with new APIs and schema changes"

This commit is contained in:
louiscklaw
2025-05-30 11:40:25 +08:00
parent 834f58bde1
commit 5a707427c6
32 changed files with 1004 additions and 122 deletions

View File

@@ -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} />
</>
);
}

View File

@@ -1,3 +1,5 @@
// src/pages/dashboard/product/details.tsx
import { useParams } from 'src/routes/hooks';
import { CONFIG } from 'src/global-config';