diff --git a/src/pages/checkout/hooks/useOrder.ts b/src/pages/checkout/hooks/useOrder.ts index c769ed8..8d8f186 100644 --- a/src/pages/checkout/hooks/useOrder.ts +++ b/src/pages/checkout/hooks/useOrder.ts @@ -72,7 +72,7 @@ export default function useOrder() { extras: i.extras?.map((e) => e.id) || [], extrasgroup: i.extrasgroup || [], order_item_comment: i.comment || "", - variant: i.variant?.id, + variant: i.variant?.id || "", })), office_no: officeDetails?.officeNo || "", vatvalue: 0, @@ -126,6 +126,41 @@ export default function useOrder() { .catch((error: any) => { console.error("Create Order failed:", error); }); - }, [createOrder, mobilenumber, phone, giftDetails?.senderPhone, giftDetails?.receiverName, giftDetails?.receiverPhone, giftDetails?.message, giftDetails?.isSecret, giftDetails?.senderEmail, giftDetails?.senderName, specialRequest, getDeliveryMethod, tables, orderType, restaurantID, items, officeDetails?.officeNo, discount.isDiscount, discount.isGift, discount.value, coupon, user_uuid, estimateTime, orderPrice, useLoyaltyPoints, highestLoyaltyItem, tip, location?.lat, location?.lng, location?.address, t, navigate, subdomain, dispatch]); + }, [ + createOrder, + mobilenumber, + phone, + giftDetails?.senderPhone, + giftDetails?.receiverName, + giftDetails?.receiverPhone, + giftDetails?.message, + giftDetails?.isSecret, + giftDetails?.senderEmail, + giftDetails?.senderName, + specialRequest, + getDeliveryMethod, + tables, + orderType, + restaurantID, + items, + officeDetails?.officeNo, + discount.isDiscount, + discount.isGift, + discount.value, + coupon, + user_uuid, + estimateTime, + orderPrice, + useLoyaltyPoints, + highestLoyaltyItem, + tip, + location?.lat, + location?.lng, + location?.address, + t, + navigate, + subdomain, + dispatch, + ]); return { handleCreateOrder }; }