diff --git "a/src/domain/\352\263\204\354\240\225\354\204\244\354\240\225/components/Form/index.tsx" "b/src/domain/\352\263\204\354\240\225\354\204\244\354\240\225/components/Form/index.tsx" index 694d3af..22392c2 100644 --- "a/src/domain/\352\263\204\354\240\225\354\204\244\354\240\225/components/Form/index.tsx" +++ "b/src/domain/\352\263\204\354\240\225\354\204\244\354\240\225/components/Form/index.tsx" @@ -1,8 +1,6 @@ -import { useRouter } from 'next/navigation'; import { type FormEvent, useMemo, useState } from 'react'; import Icon from '@components/Icon'; -import { ROUTES } from '@constants/routes'; import { useInput } from '@hooks/useInput'; import useUpdateProfile from '../../mutations/useUpdateProfile'; @@ -17,7 +15,6 @@ interface ProfileFormProps { } const ProfileForm = ({ name, nickname, authType, email }: ProfileFormProps) => { - const router = useRouter(); const { mutate: updateProfile } = useUpdateProfile(); const nameInputProps = useInput({ id: 'name', defaultValue: name }); @@ -134,7 +131,6 @@ const ProfileForm = ({ name, nickname, authType, email }: ProfileFormProps) => { name: nameInputProps.value, nickname: nicknameInputProps.value, }); - router.push(`${ROUTES.MAIN}?tab=write`); } }; diff --git "a/src/domain/\352\263\204\354\240\225\354\204\244\354\240\225/mutations/useUpdateProfile.ts" "b/src/domain/\352\263\204\354\240\225\354\204\244\354\240\225/mutations/useUpdateProfile.ts" index 6415c26..47b675a 100644 --- "a/src/domain/\352\263\204\354\240\225\354\204\244\354\240\225/mutations/useUpdateProfile.ts" +++ "b/src/domain/\352\263\204\354\240\225\354\204\244\354\240\225/mutations/useUpdateProfile.ts" @@ -23,7 +23,8 @@ const useUpdateProfile = () => { mutationFn: updateProfile, onSuccess: () => { showToast({ message: '모든 변경사항이 저장됐어요.' }); - queryClient.invalidateQueries({ queryKey: ProfileQueryKeys.all }); + queryClient.refetchQueries({ queryKey: ProfileQueryKeys.getProfile }); + queryClient.refetchQueries({ queryKey: ['my-profile'] }); }, }); };