From c9c3323fed1d00a5d3191d4cdf044e06ad968f9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=91=ED=98=84?= Date: Sat, 16 Sep 2023 22:08:26 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=ED=9A=8C=EC=9B=90=ED=83=88=ED=87=B4?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=A0=95=EC=83=81=ED=99=94=20=ED=9A=8C?= =?UTF-8?q?=EC=9B=90=20=ED=83=88=ED=87=B4=20=ED=9B=85=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=95=84=EB=AC=B4=20=EC=9E=85=EB=A0=A5=EB=8F=84=20=EC=95=88?= =?UTF-8?q?=EB=B0=9B=EB=8F=84=EB=A1=9D=20=EB=B3=80=EB=8F=99=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=ED=95=84=20=EC=B0=BD=20=ED=9A=8C=EC=9B=90=20=ED=83=88?= =?UTF-8?q?=ED=87=B4=20=ED=83=AD=EC=97=90=EC=84=9C=20Codestates=20?= =?UTF-8?q?=EB=AC=B8=EC=9E=90=EC=97=B4=EC=9D=84=20=EC=9E=85=EB=A0=A5?= =?UTF-8?q?=ED=95=98=EA=B3=A0=20=EB=B2=84=ED=8A=BC=EC=9D=84=20=EB=88=84?= =?UTF-8?q?=EB=A5=B4=EB=A9=B4=20=ED=9A=8C=EC=9B=90=ED=83=88=ED=87=B4=20Iss?= =?UTF-8?q?ues=20#70?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/Profile/memberWithdrawalModal.tsx | 9 ++------- client/src/hooks/useDeleteMembers.ts | 10 ++++++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/client/src/components/Profile/memberWithdrawalModal.tsx b/client/src/components/Profile/memberWithdrawalModal.tsx index 104ae459..4ed67741 100644 --- a/client/src/components/Profile/memberWithdrawalModal.tsx +++ b/client/src/components/Profile/memberWithdrawalModal.tsx @@ -14,13 +14,8 @@ const MemberWithdrawalModal: React.FC = ({ onClose } const withdrawalButtonText = "회원탈퇴"; const handleWithdrawal = () => { - if (inputString === "Codestates/seb-45_main_008") { - deleteMemberMutation.mutate(inputString, { - onSuccess: () => { - alert('회원탈퇴 되었습니다!'); - onClose(); - } - }); + if (inputString === "Codestates") { + deleteMemberMutation.mutate(); } else { setErrorMsg(incorrectStringMsg); } diff --git a/client/src/hooks/useDeleteMembers.ts b/client/src/hooks/useDeleteMembers.ts index 8e75c701..647ee783 100644 --- a/client/src/hooks/useDeleteMembers.ts +++ b/client/src/hooks/useDeleteMembers.ts @@ -2,13 +2,15 @@ import { useMutation } from 'react-query'; import axios from 'axios'; export function useDeleteMember() { - return useMutation(async (password: string) => { // 비밀번호를 인자로 받음 - const response = await axios.delete(`http://ec2-13-125-246-160.ap-northeast-2.compute.amazonaws.com/members/`, { - data: { password } // 비밀번호를 request body에 전송 - }); + return useMutation(async () => { + const response = await axios.delete(`http://ec2-13-125-246-160.ap-northeast-2.compute.amazonaws.com/members/`); if (response.status !== 204) { throw new Error('Failed to delete member'); } + }, { + onSuccess: () => { + alert('회원탈퇴 되었습니다!'); + } }); }