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
Hide whitespace changes
Inline
Side-by-side
frontend/src/auth/profile.tsx
View file @
0ae2a2b5
...
@@ -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
.
p
icture
(
formdata
);
await
profileApi
.
p
rofileUpload
(
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
(()
=>
{
...
...
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