diff --git a/src/components/DetailSectionTop/DetailToursInfo.tsx b/src/components/DetailSectionTop/DetailToursInfo.tsx index 3b024d45..c4a0edf9 100644 --- a/src/components/DetailSectionTop/DetailToursInfo.tsx +++ b/src/components/DetailSectionTop/DetailToursInfo.tsx @@ -2,7 +2,6 @@ import { HeartIcon } from '@components/common/icons/Icons'; import { postLikedTours, deleteLikedTours } from '@api/tours'; import { useMutation, useQueryClient } from '@tanstack/react-query'; import { useNavigate } from 'react-router-dom'; -import { useState } from 'react'; interface DetailToursInfoProps { infoData: tourDetail; @@ -11,8 +10,6 @@ interface DetailToursInfoProps { export default function DetailToursInfo({ infoData }: DetailToursInfoProps) { const { title, liked, originalThumbnailUrl, id } = infoData; - const [isLiked, setIsLiked] = useState(liked); - const navigate = useNavigate(); const queryClient = useQueryClient(); @@ -20,7 +17,6 @@ export default function DetailToursInfo({ infoData }: DetailToursInfoProps) { mutationFn: (id: number) => postLikedTours({ id }), onSuccess: () => { queryClient.invalidateQueries({ queryKey: ['details'] }); - setIsLiked(true); }, onError: () => console.log('error'), }); @@ -29,7 +25,6 @@ export default function DetailToursInfo({ infoData }: DetailToursInfoProps) { mutationFn: (id: number) => deleteLikedTours({ id }), onSuccess: () => { queryClient.invalidateQueries({ queryKey: ['details'] }); - setIsLiked(false); }, onError: () => console.log('error'), }); @@ -63,8 +58,7 @@ export default function DetailToursInfo({ infoData }: DetailToursInfoProps) {