Skip to content

Commit

Permalink
Merge pull request #44 from Soongsil-CoffeeChat/feat/#43-QA-사항-수정
Browse files Browse the repository at this point in the history
feat: add deleting accout
  • Loading branch information
haesol822 authored Nov 13, 2024
2 parents 224a51b + 31304b2 commit 6c0c51e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Binary file modified src/.DS_Store
Binary file not shown.
16 changes: 16 additions & 0 deletions src/pages/mypage/mypage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ export default function MyPage() {
navigate("/login");
};

const handleWithdrawal = async () => {
try {
const response = await axiosInstance.delete("/users");
console.log(response.data);
} catch (error) {
console.error('Error deleting account:', error);
alert("회원 탈퇴가 완료되었습니다.");
navigate("/login");
}
};

const handleMyProfileButton = () => {
navigate("/mypage/myprofile");
};
Expand Down Expand Up @@ -212,6 +223,11 @@ export default function MyPage() {
<S.MenuText>로그아웃</S.MenuText>
<S.ArrowImg src={Arrow} alt="Arrow" style={{ opacity: "0" }} />
</S.MenuWrapper>
<S.Hr />
<S.MenuWrapper onClick={handleWithdrawal}>
<S.MenuText>탈퇴하기</S.MenuText>
<S.ArrowImg src={Arrow} alt="Arrow" style={{ opacity: "0" }} />
</S.MenuWrapper>
</S.MenuContainer>
</S.BodyContainer>
</Container>
Expand Down

0 comments on commit 6c0c51e

Please sign in to comment.