Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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