From 8b8d986004d1c27f132ee4ee7fbf43d387bf503c Mon Sep 17 00:00:00 2001 From: NohWookJin Date: Sat, 6 Jan 2024 20:14:26 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=A2=8B=EC=95=84=EC=9A=94=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EA=B5=AC=ED=98=84=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DetailSectionTop/DetailToursInfo.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) 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) {