diff --git a/frontend/src/pages/ManageOrderTenant.tsx b/frontend/src/pages/ManageOrderTenant.tsx index 0a9e2ef36d68d05afff0497414713e9322ee6dc0..98a2955aad8000b8cd28344ce5754e91524a44cc 100644 --- a/frontend/src/pages/ManageOrderTenant.tsx +++ b/frontend/src/pages/ManageOrderTenant.tsx @@ -82,13 +82,13 @@ export default function OrderDetails() { const orderproduct = orderProductData.filter((orderProduct: OrderProduct) => orderProduct.id_order === order.id); const listproduct = orderproduct.map((orderProduct: OrderProduct) => { const product = productData.find((product: Product) => product.id === orderProduct.id_product); - return [product.name, orderProduct.num_product, product.price]; - }) + return [product?.name || 'Product Not Found', orderProduct.num_product, product?.price || 0]; + }); return { - name: tenant.name, + name: tenant?.name || 'Tenant Not Found', orderlist: listproduct - } + }; }); setJoinedOrderSummaryData(result);