Commit 34980609 authored by Lee SeoYeon's avatar Lee SeoYeon
Browse files

제목 입력시 확인 가능, 제목과 선택지 입력시 확인가능

parent 0150d3d8
...@@ -18,9 +18,13 @@ export const Question = ({ ...@@ -18,9 +18,13 @@ export const Question = ({
const isEditing = question.isEditing; const isEditing = question.isEditing;
async function handleEditComplete() { async function handleEditComplete() {
if (question.content.length < 0 || question.title.length > 1) {
question.isEditing = false;
handleQuestion(question);
}
question.content.choices.map((choice) => { question.content.choices.map((choice) => {
if (choice.text.trim() === "") { if (question.title.length < 1 || choice.text.trim() === "") {
alert("질문작성이 완료되지 않았습니다."); alert("빈칸을 채워주세요");
return (question.isEditing = true); return (question.isEditing = true);
} else { } else {
question.isEditing = false; question.isEditing = 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