From 490c6eb1d92a0a1c061e052bd102d2870ef0bad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EA=B8=B0=EC=98=81?= Date: Mon, 5 Aug 2024 11:15:53 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20put/post=20=EC=9D=B4=ED=9B=84=20?= =?UTF-8?q?=EB=A6=AC=EB=8B=A4=EC=9D=B4=EB=A0=89=ED=8A=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/MyInfoChangePage/MyInfoChangePage.jsx | 4 +++- .../src/pages/PasswordChangePage/PasswordChangePage.jsx | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/MyInfoChangePage/MyInfoChangePage.jsx b/frontend/src/pages/MyInfoChangePage/MyInfoChangePage.jsx index 0d5f340..19a4b91 100644 --- a/frontend/src/pages/MyInfoChangePage/MyInfoChangePage.jsx +++ b/frontend/src/pages/MyInfoChangePage/MyInfoChangePage.jsx @@ -1,13 +1,15 @@ import { InfoEditForm } from '../../components/InfoEditForm'; import { useAuth } from '../../hooks/api/useAuth'; +import { useNavigate } from 'react-router-dom'; export default function MyInfoChangePage() { + const navigate = useNavigate(); const { updateInfo } = useAuth(); const handleSubmit = async (e, username, useremail) => { e.preventDefault(); await updateInfo(username, useremail) - .then((res) => console.log(res)) + .then(() => navigate('/')) .catch((err) => console.log(err)); }; diff --git a/frontend/src/pages/PasswordChangePage/PasswordChangePage.jsx b/frontend/src/pages/PasswordChangePage/PasswordChangePage.jsx index 4aef72f..1ed2734 100644 --- a/frontend/src/pages/PasswordChangePage/PasswordChangePage.jsx +++ b/frontend/src/pages/PasswordChangePage/PasswordChangePage.jsx @@ -1,12 +1,12 @@ import { PasswordChangeForm } from '../../components/PasswordChangeForm'; import { useAuth } from '../../hooks/api/useAuth'; +import { useNavigate } from 'react-router-dom'; export default function PasswordChangePage() { - // TODO: 400에러 고치기 + const navigate = useNavigate(); const { updatePassword } = useAuth(); const handleSubmit = async (currentPw, newPw, newPwCheck) => { - console.log(currentPw, newPw); - await updatePassword(currentPw, newPw, newPwCheck); + await updatePassword(currentPw, newPw, newPwCheck).then(() => navigate('/')); }; return ; }