diff --git a/frontend/src/pages/admin/AdminStudentAssignment.jsx b/frontend/src/pages/admin/AdminStudentAssignment.jsx index 3ff03d3..ee2bffd 100644 --- a/frontend/src/pages/admin/AdminStudentAssignment.jsx +++ b/frontend/src/pages/admin/AdminStudentAssignment.jsx @@ -14,17 +14,19 @@ import { const AdminStudentAssignment = () => { const { studentId, week } = useParams(); - if (!studentId || !week) { - console.warn("studentId 또는 week 없음", { studentId, week }); - return
잘못된 접근입니다.
; // 또는 로딩 UI - } const [studentInfo, setStudentInfo] = useState(null); const [weeks, setWeeks] = useState([]); const [highlightCard, setHighlightCard] = useState(null); const [selectedWeekLabel, setSelectedWeekLabel] = useState(null); useEffect(() => { - fetchStudentInfo(studentId).then((res) => { + const id = Number(studentId); + if (!id || isNaN(id)) { + console.warn("❗ 잘못된 studentId:", studentId); + return; + } + + fetchStudentInfo(id).then((res) => { setStudentInfo(res.data.data); }); diff --git a/frontend/src/pages/admin/AdminStudentAttendance.jsx b/frontend/src/pages/admin/AdminStudentAttendance.jsx index 9bdc211..5e75e02 100644 --- a/frontend/src/pages/admin/AdminStudentAttendance.jsx +++ b/frontend/src/pages/admin/AdminStudentAttendance.jsx @@ -14,6 +14,11 @@ const AdminStudentAttendance = () => { const [selectedDate, setSelectedDate] = useState(null); useEffect(() => { + const id = Number(studentId); + if (!id || isNaN(id)) { + console.warn("❗ 잘못된 studentId:", studentId); + return; + } const fetchData = async () => { try { const studentRes = await getStudentBasicInfo(studentId);