diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index 17114760..cd291c52 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -64,7 +64,7 @@ const Header = memo(({ handleGoBack }: HeaderProps) => { {user?.path ? ( -
+
my
) : ( diff --git a/src/pages/MyPage/index.tsx b/src/pages/MyPage/index.tsx index c03c4d41..1c6ed6d1 100644 --- a/src/pages/MyPage/index.tsx +++ b/src/pages/MyPage/index.tsx @@ -1,6 +1,6 @@ import { ChangeEvent, useRef } from 'react' -import { useNameCheck, usePasswordCheck } from '@/hooks' -import { Header, Input } from '@/components' +import { useNameCheck, usePasswordCheck, useToast } from '@/hooks' +import { Header, Input, Modal } from '@/components' import { useEditImage, useUser } from '@/apis/hooks' import { BasicProfileIcon, @@ -12,8 +12,9 @@ import { useEditNameCheck, useEditPasswordCheck } from './hooks' const MyPage = () => { const fileInputRef = useRef(null) - const { data: user } = useUser() + const { data: user, refetch } = useUser() const { mutate: editImage } = useEditImage() + const { addToast } = useToast() const { name, @@ -70,7 +71,13 @@ const MyPage = () => { editImage( { image: formData }, { - onSuccess: ({ data }) => console.log(data), + onSuccess: () => { + refetch() + addToast({ + message: '이미지 변경이 완료되었습니다.', + type: 'success', + }) + }, }, ) } @@ -83,7 +90,9 @@ const MyPage = () => {
{user?.path ? ( - profile-image +
+ profile-image +
) : ( )}