Skip to content

Commit

Permalink
fix: rebase 반영 시 빠진 코드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
deepbig committed Jan 17, 2024
1 parent e6c9bfd commit ec445cd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/features/goal/components/detail/DeleteGoalButtomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useRouter } from 'next/navigation';

import BandiMoori from '@/assets/images/bandi-moori.png';
import { BottomSheet, Button, Typography } from '@/components/atoms';
import { useGetMemberData } from '@/hooks/reactQuery/auth';
import { useDeleteGoal } from '@/hooks/reactQuery/goal';

interface DeleteGoalButtomSheetProps {
Expand All @@ -16,14 +17,15 @@ interface DeleteGoalButtomSheetProps {

export const DeleteGoalButtomSheet = ({ open, onClose, goalId }: DeleteGoalButtomSheetProps) => {
const { mutate, isSuccess, isError } = useDeleteGoal();
const { data: memberData } = useGetMemberData();
const router = useRouter();

useEffect(() => {
if (isSuccess) {
onClose();
router.push('/home');
router.push(`/home/${memberData?.username}`);
}
}, [isSuccess, isError, onClose, router]);
}, [isSuccess, isError, onClose, router, memberData]);

const handleDelete = () => {
if (!goalId) {
Expand Down

0 comments on commit ec445cd

Please sign in to comment.