From 27388e51329f518c3ec0d60350e25834f7f76365 Mon Sep 17 00:00:00 2001 From: Samandar Turgunboyev Date: Fri, 23 Jan 2026 19:31:53 +0500 Subject: [PATCH] order create --- src/features/cart/ui/OrderPage.tsx | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) 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: [