Commit 0ba15432 authored by Jiwon Yoon's avatar Jiwon Yoon
Browse files

질문 삭제 확인(confirm)

parent 5e91a8fd
......@@ -28,7 +28,7 @@ export const MySurveyCard = ({ data }: Props) => {
};
async function deleteSurvey() {
if (window.confirm("정말 삭제하시겠습니까?")) {
if (window.confirm("해당 설문조사를 삭제하시겠습니까?")) {
try {
if (data._id) {
const survey = await surveyApi.deleteSurvey(data._id);
......
......@@ -50,11 +50,7 @@ export const Question = ({
selectedType === "checkbox"
) {
element.content = {
choices: [
{ text: "", value: 0 },
{ text: "", value: 1 },
{ text: "", value: 2 },
],
choices: [{ text: "", value: 0 }],
};
} else if (selectedType === "essay") {
element.content = { choices: [] };
......@@ -62,11 +58,7 @@ export const Question = ({
element.content = {
minRateDescription: "",
maxRateDescription: "",
choices: [
{ text: "", value: 0 },
{ text: "", value: 1 },
{ text: "", value: 2 },
],
choices: [{ text: "", value: 0 }],
};
}
element.type = selectedType;
......@@ -129,8 +121,14 @@ export const Question = ({
handleQuestion(element._id);
};
const handleDelete = () => {
deleteQuestion(element._id);
if (window.confirm("질문을 삭제하시겠습니까?")) {
deleteQuestion(element._id);
alert("삭제되었습니다.");
} else {
alert("질문 삭제를 취소합니다.");
}
};
const handleEditClick = () => {
setSave(false);
};
......
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