Skip to content

Commit 7cf4fbb

Browse files
authored
Merge pull request #290 from WeGo-Together/somang-fix/group-details
[Fix] 모임삭제 이후 메인루트 경로로 redirect 처리 적용
2 parents 68d198d + b4a1ed4 commit 7cf4fbb

File tree

1 file changed

+6
-2
lines changed
  • src/components/pages/group/group-modal

1 file changed

+6
-2
lines changed

src/components/pages/group/group-modal/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import { useParams } from 'next/navigation';
3+
import { useParams, useRouter } from 'next/navigation';
44

55
import { GroupModalApprovalContent } from '@/components/pages/group/group-modal/approval-content';
66
import { GroupModalCommonContent } from '@/components/pages/group/group-modal/common-content';
@@ -30,6 +30,7 @@ type Props = BaseProps | KickProps;
3030
export const GroupModal = (props: Props) => {
3131
const { type } = props;
3232

33+
const { replace } = useRouter();
3334
const { groupId } = useParams() as { groupId: string };
3435

3536
const { mutateAsync: attendMutate, isPending: isAttending } = useAttendGroup({ groupId });
@@ -46,7 +47,10 @@ export const GroupModal = (props: Props) => {
4647
attend: () => attendMutate(undefined),
4748
approval: (message: AttendGroupPayload) => attendMutate(message),
4849
leave: () => leaveMutate(),
49-
delete: () => deleteMutate(),
50+
delete: async () => {
51+
await deleteMutate();
52+
replace('/');
53+
},
5054
kick: () => kickMutate(),
5155
};
5256

0 commit comments

Comments
 (0)