Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
travel
Commits
0ae2a2b5
Commit
0ae2a2b5
authored
Jul 23, 2022
by
Kim, MinGyu
Browse files
계정삭제-로그아웃 문제
parent
d1f8541e
Changes
1
Show whitespace changes
Inline
Side-by-side
frontend/src/auth/profile.tsx
View file @
0ae2a2b5
...
...
@@ -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
.
p
icture
(
formdata
);
await
profileApi
.
p
rofileUpload
(
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
(()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment