diff --git a/src/features/cart/ui/OrderPage.tsx b/src/features/cart/ui/OrderPage.tsx index e356d95..d1df956 100644 --- a/src/features/cart/ui/OrderPage.tsx +++ b/src/features/cart/ui/OrderPage.tsx @@ -259,19 +259,15 @@ const OrderPage = () => { return; } - const order_products = []; - - cartItems.forEach((e) => { - order_products.push({ - inventory_kind: 'G', - product_code: e.product.code, - on_balance: 'Y', - order_quant: e.quantity, - price_type_code: e.product.prices[0].price_type.code, - product_price: e.product.prices[0].price, - warehouse_code: 'wh1', - }); - }); + const order_products = cartItems.map((item) => ({ + inventory_kind: 'G', + product_code: item.product.code, + on_balance: 'Y', + order_quant: item.quantity, + price_type_code: item.product.prices?.[0]?.price_type?.code, + product_price: item.product.prices?.[0]?.price, + warehouse_code: 'wh1', + })); mutate({ order: [