order create

This commit is contained in:
Samandar Turgunboyev
2026-01-23 19:31:53 +05:00
parent f22b620034
commit 27388e5132

View File

@@ -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: [