Commit 0ae2a2b5 authored by Kim, MinGyu's avatar Kim, MinGyu
Browse files

계정삭제-로그아웃 문제

parent d1f8541e
......@@ -47,32 +47,39 @@ export default function Profile() {
const userChange = async () => {
const profile = await handleProfile();
setEmail(profile.email);
setPicturename(profile.avatar.newfilename);
setPlaceholder(profile.avatar.nickname);
setPicturename(profile.fileInfo.newfilename);
setPlaceholder(profile.fileInfo.nickname);
};
const handleClick = async (
e: React.MouseEvent<HTMLButtonElement, globalThis.MouseEvent>
) => {
e.preventDefault();
const formdata = new FormData();
if (!(file === undefined || nickname === "")) {
formdata.append("picture", file);
formdata.append("nickname", nickname);
console.log("both");
await profileApi.picture(formdata);
await profileApi.profileUpload(formdata);
} else if (!(nickname === "")) {
formdata.append("nickname", nickname);
console.log("picture");
await profileApi.picture(formdata);
await profileApi.profileUpload(formdata);
} else if (!(file === undefined)) {
formdata.append("picture", file);
await profileApi.profileUpload(formdata);
} else {
alert("수정할 정보를 입력해주세요.");
}
};
const deleteClick = async () => {
await profileApi.deleteUser().then(() => {
logout();
console.log("test");
});
if (confirm("삭제하시겠습니까?") == true) {
const success = await profileApi.deleteUser();
if (success) {
await logout();
}
} else {
}
};
useEffect(() => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment