refactor the use of plain string order types
This commit is contained in:
@@ -3,7 +3,7 @@ import {
|
||||
clearCart,
|
||||
selectCart,
|
||||
selectGrandTotal,
|
||||
selectHighestPricedLoyaltyItem
|
||||
selectHighestPricedLoyaltyItem,
|
||||
} from "features/order/orderSlice";
|
||||
import { useCallback } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -12,6 +12,7 @@ import { useCreateOrderMutation } from "redux/api/others";
|
||||
import { useAppDispatch, useAppSelector } from "redux/hooks";
|
||||
import { PAYMENT_CONFIRMATION_URL } from "utils/constants";
|
||||
import { Customer } from "../../otp/types";
|
||||
import { OrderType } from "pages/checkout/hooks/types.ts";
|
||||
|
||||
export default function useOrder() {
|
||||
const dispatch = useAppDispatch();
|
||||
@@ -72,7 +73,7 @@ export default function useOrder() {
|
||||
use_loylaty: useLoyaltyPoints && highestLoyaltyItem ? 1 : 0,
|
||||
useWallet: 0,
|
||||
tip,
|
||||
...(orderType === "gift"
|
||||
...(orderType === OrderType.Gift
|
||||
? {
|
||||
receiverName: giftDetails?.receiverName,
|
||||
receiverPhone: giftDetails?.receiverPhone,
|
||||
|
||||
Reference in New Issue
Block a user