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

계정삭제-로그아웃 문제

parent d1f8541e
...@@ -47,32 +47,39 @@ export default function Profile() { ...@@ -47,32 +47,39 @@ export default function Profile() {
const userChange = async () => { const userChange = async () => {
const profile = await handleProfile(); const profile = await handleProfile();
setEmail(profile.email); setEmail(profile.email);
setPicturename(profile.avatar.newfilename); setPicturename(profile.fileInfo.newfilename);
setPlaceholder(profile.avatar.nickname); setPlaceholder(profile.fileInfo.nickname);
}; };
const handleClick = async ( const handleClick = async (
e: React.MouseEvent<HTMLButtonElement, globalThis.MouseEvent> e: React.MouseEvent<HTMLButtonElement, globalThis.MouseEvent>
) => { ) => {
e.preventDefault();
const formdata = new FormData(); const formdata = new FormData();
if (!(file === undefined || nickname === "")) { if (!(file === undefined || nickname === "")) {
formdata.append("picture", file); formdata.append("picture", file);
formdata.append("nickname", nickname); formdata.append("nickname", nickname);
console.log("both"); console.log("both");
await profileApi.picture(formdata); await profileApi.profileUpload(formdata);
} else if (!(nickname === "")) { } else if (!(nickname === "")) {
formdata.append("nickname", nickname); formdata.append("nickname", nickname);
console.log("picture"); console.log("picture");
await profileApi.picture(formdata); await profileApi.profileUpload(formdata);
} else if (!(file === undefined)) {
formdata.append("picture", file);
await profileApi.profileUpload(formdata);
} else { } else {
alert("수정할 정보를 입력해주세요."); alert("수정할 정보를 입력해주세요.");
} }
}; };
const deleteClick = async () => { const deleteClick = async () => {
await profileApi.deleteUser().then(() => { if (confirm("삭제하시겠습니까?") == true) {
logout(); const success = await profileApi.deleteUser();
console.log("test"); if (success) {
}); await logout();
}
} else {
}
}; };
useEffect(() => { 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