diff --git a/frontend/src/components/Header/Header.jsx b/frontend/src/components/Header/Header.jsx
index 2cb579a..4db4a3e 100644
--- a/frontend/src/components/Header/Header.jsx
+++ b/frontend/src/components/Header/Header.jsx
@@ -26,14 +26,6 @@ export default function Header() {
/>
-
-
- live
-
-
{userType && (
diff --git a/frontend/src/components/LectureForm/LectureForm.jsx b/frontend/src/components/LectureForm/LectureForm.jsx
index 8355780..b43b482 100644
--- a/frontend/src/components/LectureForm/LectureForm.jsx
+++ b/frontend/src/components/LectureForm/LectureForm.jsx
@@ -38,8 +38,21 @@ export default function LectureForm({ title, topic, to = '..', initialValues = {
if (initialValues.time) timeRef.current.value = initialValues.time;
}, [initialValues]);
+ console.log(startDateRef.current.value, endDateRef.current.value);
+
const handleSubmit = async (e) => {
e.preventDefault();
+ const startDate = new Date(startDateRef.current.value);
+ const endDate = new Date(endDateRef.current.value);
+ if (startDate > endDate) {
+ window.alert('시작 날짜가 끝나는 날짜보다 더 늦습니다.');
+ return;
+ }
+
+ if (startDate <= new Date(Date.now() - 86400000)) {
+ window.alert('시작 날짜는 오늘 이후여야 합니다.');
+ return;
+ }
const lectureObject = {
title: titleRef.current.value,
@@ -49,7 +62,7 @@ export default function LectureForm({ title, topic, to = '..', initialValues = {
endDate: new Date(endDateRef.current.value).toISOString(),
time: timeRef.current.value,
};
-
+ console.log(lectureObject);
const formData = new FormData();
formData.append('lectureCreateRequest', new Blob([JSON.stringify(lectureObject)], { type: 'application/json' }));
@@ -84,6 +97,7 @@ export default function LectureForm({ title, topic, to = '..', initialValues = {
maxLength={50}
type="text"
placeholder="강의명을 입력하세요"
+ required
/>
@@ -91,6 +105,7 @@ export default function LectureForm({ title, topic, to = '..', initialValues = {
@@ -99,6 +114,7 @@ export default function LectureForm({ title, topic, to = '..', initialValues = {
@@ -110,6 +126,7 @@ export default function LectureForm({ title, topic, to = '..', initialValues = {
className={styles.input}
ref={startDateRef}
type="date"
+ required
/>
부터
@@ -118,6 +135,7 @@ export default function LectureForm({ title, topic, to = '..', initialValues = {
className={styles.input}
ref={endDateRef}
type="date"
+ required
/>
까지