Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions frontend/src/pages/admin/AdminStudentAssignment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,19 @@ import {

const AdminStudentAssignment = () => {
const { studentId, week } = useParams();
if (!studentId || !week) {
console.warn("studentId 또는 week 없음", { studentId, week });
return <div>잘못된 접근입니다.</div>; // 또는 로딩 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);
});

Expand Down
5 changes: 5 additions & 0 deletions frontend/src/pages/admin/AdminStudentAttendance.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down