diff --git a/frontend/src/pages/curriculum/CurriculumPage.js b/frontend/src/pages/curriculum/CurriculumPage.js index e65f1ce..400fcbe 100644 --- a/frontend/src/pages/curriculum/CurriculumPage.js +++ b/frontend/src/pages/curriculum/CurriculumPage.js @@ -132,6 +132,7 @@ function AdminSessionCard({ day, onEdit, onDelete }) { // ── 운영진 세션 생성/수정 폼 ────────────────────────── function SessionForm({ day, week, onClose, onSave }) { const isEdit = !!day; + const [errors, setErrors] = useState({}); const [form, setForm] = useState({ week: day?.week || week || 1, sessionDate: day?.sessionDate || '', @@ -164,6 +165,13 @@ function SessionForm({ day, week, onClose, onSave }) { }; const handleSave = async () => { + const newErrors = {}; + if (!form.sessionDate) newErrors.sessionDate = '날짜를 입력해주세요.'; + if (!form.amTitle) newErrors.amTitle = '오전 세션 제목을 입력해주세요.'; + if (!form.pmTitle) newErrors.pmTitle = '오후 세션 제목을 입력해주세요.'; + if (Object.keys(newErrors).length > 0) { setErrors(newErrors); return; } + setErrors({}); + const body = { generation: Number(form.generation), week: Number(form.week), @@ -235,9 +243,10 @@ function SessionForm({ day, week, onClose, onSave }) { readOnly />
{errors.sessionDate}
}{errors.amTitle}
}{errors.pmTitle}
}