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
survey
Commits
5e91a8fd
Commit
5e91a8fd
authored
Jul 27, 2022
by
Jiwon Yoon
Browse files
설문지 삭제 확인(confirm)
parent
56d0596c
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/src/profile/MySurveyCard.tsx
View file @
5e91a8fd
...
@@ -28,20 +28,25 @@ export const MySurveyCard = ({ data }: Props) => {
...
@@ -28,20 +28,25 @@ export const MySurveyCard = ({ data }: Props) => {
};
};
async
function
deleteSurvey
()
{
async
function
deleteSurvey
()
{
try
{
if
(
window
.
confirm
(
"
정말 삭제하시겠습니까?
"
))
{
if
(
data
.
_id
)
{
try
{
const
survey
=
await
surveyApi
.
deleteSurvey
(
data
.
_id
);
if
(
data
.
_id
)
{
setSuccess
(
true
);
const
survey
=
await
surveyApi
.
deleteSurvey
(
data
.
_id
);
setError
(
""
);
setSuccess
(
true
);
location
.
reload
();
setError
(
""
);
}
else
{
alert
(
"
삭제되었습니다.
"
);
setLoading
(
true
);
location
.
reload
();
}
else
{
setLoading
(
true
);
}
}
catch
(
error
)
{
console
.
log
(
"
에러발생
"
);
catchErrors
(
error
,
setError
);
}
finally
{
setLoading
(
false
);
}
}
}
catch
(
error
)
{
}
else
{
console
.
log
(
"
에러발생
"
);
alert
(
"
삭제를 취소합니다.
"
);
catchErrors
(
error
,
setError
);
}
finally
{
setLoading
(
false
);
}
}
}
}
...
...
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