File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/components/pages/group/group-modal Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 11'use client' ;
22
3- import { useParams } from 'next/navigation' ;
3+ import { useParams , useRouter } from 'next/navigation' ;
44
55import { GroupModalApprovalContent } from '@/components/pages/group/group-modal/approval-content' ;
66import { GroupModalCommonContent } from '@/components/pages/group/group-modal/common-content' ;
@@ -30,6 +30,7 @@ type Props = BaseProps | KickProps;
3030export 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
You can’t perform that action at this time.
0 commit comments