added k8s specific changes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useParams } from "react-router-dom";
|
||||
import { useEffect } from "react";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import Breadcrumb from "../../components/ui/Breadcrumb";
|
||||
import ProductImages from "./ProductImages";
|
||||
import ProductInfo from "./ProductInfo";
|
||||
@@ -19,9 +19,10 @@ import RecommendedForYou from "../home/RecommendedForYou/RecommendedForYou";
|
||||
const ProductDetails = () => {
|
||||
const { slug } = useParams();
|
||||
const dispatch = useDispatch();
|
||||
const token = useSelector((state) => state.auth.token);
|
||||
|
||||
const { data, isLoading, isError } = useGetProductBySlugQuery(slug);
|
||||
const { data: wishlistData } = useGetWishlistQuery();
|
||||
const { data: wishlistData } = useGetWishlistQuery(undefined, { skip: !token });
|
||||
|
||||
const [addToWishlist] = useAddToWishlistMutation();
|
||||
const [removeFromWishlist] = useRemoveFromWishlistMutation();
|
||||
|
||||
Reference in New Issue
Block a user