From 4dfa08d26cc862d8d5c6e70432330f30a820d86b Mon Sep 17 00:00:00 2001 From: Mohammed Al-yaseen Date: Thu, 15 Jan 2026 14:28:00 +0300 Subject: [PATCH] room number value sending --- src/components/Icons/order/RateIcon.tsx | 10 +++++----- src/components/InputCard.tsx | 2 +- src/components/OrderSummary/OrderSummary.tsx | 4 ++-- src/features/order/orderSlice.ts | 3 ++- src/pages/checkout/hooks/useOrder.ts | 14 +++++++++++--- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/components/Icons/order/RateIcon.tsx b/src/components/Icons/order/RateIcon.tsx index e8137a9..bcedfea 100644 --- a/src/components/Icons/order/RateIcon.tsx +++ b/src/components/Icons/order/RateIcon.tsx @@ -17,7 +17,7 @@ const RateIcon = ({ className, onClick }: RateIconType) => { { - + @@ -167,7 +167,7 @@ export default function OrderSummary() { /> )} - {orderType !== OrderType.Redeem && ( + {orderType !== OrderType.Redeem && (
{t("cart.otherTaxes")} diff --git a/src/features/order/orderSlice.ts b/src/features/order/orderSlice.ts index ae57e43..bfb95a8 100644 --- a/src/features/order/orderSlice.ts +++ b/src/features/order/orderSlice.ts @@ -702,7 +702,8 @@ const orderSlice = createSlice({ } }, updateOrder(state, action: PayloadAction) { - state.order = { ...state.order, ...action.payload }; + state.order = { ...(state.order || {}), ...action.payload }; + if (typeof window !== "undefined") { localStorage.setItem( CART_STORAGE_KEYS.ORDER, diff --git a/src/pages/checkout/hooks/useOrder.ts b/src/pages/checkout/hooks/useOrder.ts index 5de57d0..e175d8a 100644 --- a/src/pages/checkout/hooks/useOrder.ts +++ b/src/pages/checkout/hooks/useOrder.ts @@ -44,7 +44,7 @@ export default function useOrder() { giftDetails, order, restaurant, - } = useAppSelector(selectCart); + } = useAppSelector((state) => state.order); const highestLoyaltyItem = useAppSelector(selectHighestPricedLoyaltyItem); const { useLoyaltyPoints } = useAppSelector(selectCart); @@ -54,8 +54,6 @@ export default function useOrder() { const [createOrder] = useCreateOrderMutation(); - console.log(order); - const getDeliveryMethod = useCallback(() => { if (orderType === OrderType.Delivery) return 1; if (orderType === OrderType.Pickup) return 2; @@ -77,6 +75,8 @@ export default function useOrder() { duration: 0, }); + console.log(order?.roomNumber); + createOrder({ phone: mobilenumber || phone || giftDetails?.senderPhone, comment: specialRequest, @@ -204,6 +204,14 @@ export default function useOrder() { location?.lat, location?.lng, location?.address, + order, + pickupTime, + pickupDate, + plateCar, + pickupType, + discountAmount, + subtotal, + restaurant, t, navigate, subdomain,