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
0ba15432
Commit
0ba15432
authored
Jul 27, 2022
by
Jiwon Yoon
Browse files
질문 삭제 확인(confirm)
parent
5e91a8fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
frontend/src/profile/MySurveyCard.tsx
View file @
0ba15432
...
@@ -28,7 +28,7 @@ export const MySurveyCard = ({ data }: Props) => {
...
@@ -28,7 +28,7 @@ export const MySurveyCard = ({ data }: Props) => {
};
};
async
function
deleteSurvey
()
{
async
function
deleteSurvey
()
{
if
(
window
.
confirm
(
"
정말
삭제하시겠습니까?
"
))
{
if
(
window
.
confirm
(
"
해당 설문조사를
삭제하시겠습니까?
"
))
{
try
{
try
{
if
(
data
.
_id
)
{
if
(
data
.
_id
)
{
const
survey
=
await
surveyApi
.
deleteSurvey
(
data
.
_id
);
const
survey
=
await
surveyApi
.
deleteSurvey
(
data
.
_id
);
...
...
frontend/src/questions/Question.tsx
View file @
0ba15432
...
@@ -50,11 +50,7 @@ export const Question = ({
...
@@ -50,11 +50,7 @@ export const Question = ({
selectedType
===
"
checkbox
"
selectedType
===
"
checkbox
"
)
{
)
{
element
.
content
=
{
element
.
content
=
{
choices
:
[
choices
:
[{
text
:
""
,
value
:
0
}],
{
text
:
""
,
value
:
0
},
{
text
:
""
,
value
:
1
},
{
text
:
""
,
value
:
2
},
],
};
};
}
else
if
(
selectedType
===
"
essay
"
)
{
}
else
if
(
selectedType
===
"
essay
"
)
{
element
.
content
=
{
choices
:
[]
};
element
.
content
=
{
choices
:
[]
};
...
@@ -62,11 +58,7 @@ export const Question = ({
...
@@ -62,11 +58,7 @@ export const Question = ({
element
.
content
=
{
element
.
content
=
{
minRateDescription
:
""
,
minRateDescription
:
""
,
maxRateDescription
:
""
,
maxRateDescription
:
""
,
choices
:
[
choices
:
[{
text
:
""
,
value
:
0
}],
{
text
:
""
,
value
:
0
},
{
text
:
""
,
value
:
1
},
{
text
:
""
,
value
:
2
},
],
};
};
}
}
element
.
type
=
selectedType
;
element
.
type
=
selectedType
;
...
@@ -129,8 +121,14 @@ export const Question = ({
...
@@ -129,8 +121,14 @@ export const Question = ({
handleQuestion
(
element
.
_id
);
handleQuestion
(
element
.
_id
);
};
};
const
handleDelete
=
()
=>
{
const
handleDelete
=
()
=>
{
deleteQuestion
(
element
.
_id
);
if
(
window
.
confirm
(
"
질문을 삭제하시겠습니까?
"
))
{
deleteQuestion
(
element
.
_id
);
alert
(
"
삭제되었습니다.
"
);
}
else
{
alert
(
"
질문 삭제를 취소합니다.
"
);
}
};
};
const
handleEditClick
=
()
=>
{
const
handleEditClick
=
()
=>
{
setSave
(
false
);
setSave
(
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