From d02ab23599f4bb14cc202de72ecca5eff3279f26 Mon Sep 17 00:00:00 2001 From: Matthew Song Date: Thu, 17 Oct 2024 10:21:08 +0900 Subject: [PATCH] =?UTF-8?q?[KAN-134]=20fix:=20=EB=A6=AC=EB=B7=B0=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1=20=ED=9B=84=20=ED=95=B4=EB=8B=B9=20=EA=B2=8C?= =?UTF-8?q?=EC=8B=9C=EB=AC=BC=20=EC=83=81=EC=84=B8=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/Modal/MakeGatheringModal.tsx | 3 --- src/app/components/Modal/ReviewModal.tsx | 8 ++++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/app/components/Modal/MakeGatheringModal.tsx b/src/app/components/Modal/MakeGatheringModal.tsx index 5cbb18e9..1e5a7b30 100644 --- a/src/app/components/Modal/MakeGatheringModal.tsx +++ b/src/app/components/Modal/MakeGatheringModal.tsx @@ -83,11 +83,8 @@ const MakeGatheringModal = ({ onClose }: MakeGatheringModalProps) => { } onClose(); - await postGatheringToJoin(data.id); - router.push(`/gatherings/${data.id}`); - toast.success(message); }; diff --git a/src/app/components/Modal/ReviewModal.tsx b/src/app/components/Modal/ReviewModal.tsx index 55300ad8..781a426c 100644 --- a/src/app/components/Modal/ReviewModal.tsx +++ b/src/app/components/Modal/ReviewModal.tsx @@ -8,6 +8,7 @@ import ModalFrame from './ModalFrame'; import ModalHeader from './ModalHeader'; import CommentReview from './ReviewModal/CommentReview'; import HeartReview from './ReviewModal/HeartReview'; +import { useRouter } from 'next/navigation'; interface ReviewModalProps { gatheringId: number; @@ -18,12 +19,14 @@ const ReviewModal = ({ gatheringId, onClose }: ReviewModalProps) => { const [comment, setComment] = useState(''); const [score, setScore] = useState(0); + const router = useRouter(); + const handleChangeReviewComment = (e: ChangeEvent) => { setComment(e.target.value); }; const handleSubmit = async () => { - const { success, message } = await postReviews({ + const { success, data, message } = await postReviews({ gatheringId, score, comment, @@ -35,8 +38,9 @@ const ReviewModal = ({ gatheringId, onClose }: ReviewModalProps) => { return; } - toast.success(message); onClose(); + router.push(`/gatherings/${data?.gatheringId}`); + toast.success(message); }; return (