Skip to content

Commit

Permalink
Fix: form 제출 시 내 체험 목록 페이지로 이동하도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
eunji-0623 committed Jul 15, 2024
1 parent 0d6b0ef commit 442a9d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hooks/myActivity/useRegisterActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ import {
postActivityParams,
} from '@/pages/api/activities/apiactivities.types';
import { postActivity } from '@/pages/api/activities/apiactivities';
import { useRouter } from 'next/router';

export default function useRegisterActivity() {
const router = useRouter();

const postActivityMutation: UseMutationResult<
postActivityResponse,
unknown,
postActivityParams
> = useMutation({
mutationFn: postActivity,
onSuccess: () => {
window.location.reload();
router.push('/myActivity');
},
});

Expand Down

0 comments on commit 442a9d0

Please sign in to comment.