room & office number fix sending
This commit is contained in:
@@ -54,6 +54,8 @@ 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;
|
||||
@@ -93,8 +95,8 @@ export default function useOrder() {
|
||||
order_item_comment: i.comment || "",
|
||||
variant: (i.variant as Variant)?.id || "",
|
||||
})),
|
||||
office_no: order?.officeNumber || "",
|
||||
room_no: order?.roomNumber || "",
|
||||
office_no: order?.officeNumber,
|
||||
room_no: order?.roomNumber,
|
||||
...(discount.isDiscount ? { couponID: coupon } : {}),
|
||||
...(discount.isGift ? { discountGiftCode: coupon } : {}),
|
||||
discountAmount: discountAmount || 0,
|
||||
|
||||
@@ -35,7 +35,15 @@ export default function CheckoutPage() {
|
||||
} = useAppSelector(selectCart);
|
||||
const { token } = useAppSelector((state) => state.auth);
|
||||
useEffect(() => {
|
||||
form.setFieldsValue({ coupon, collectionMethod, phone, customerName, tip });
|
||||
form.setFieldsValue({
|
||||
coupon,
|
||||
collectionMethod,
|
||||
phone,
|
||||
customerName,
|
||||
tip,
|
||||
officeNumber: order?.officeNumber,
|
||||
roomNumber: order?.roomNumber,
|
||||
});
|
||||
}, [form, phone, coupon, collectionMethod, customerName, tip]);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user