diff --git a/src/components/Submit.tsx b/src/components/Submit.tsx index c6905dd..55a7468 100644 --- a/src/components/Submit.tsx +++ b/src/components/Submit.tsx @@ -27,22 +27,22 @@ const Submit: FC = () => { api.client.get("/steps/" + assignment_id).then((response) => { if (isProfessor) { console.log(response.data) - // 기존 코드로 인해 list에 값이 중복으로 들어가게 되므로 삭제 - //for (let i = 0; i < response.data.length; i++) { - // tmpList.push({ - // id: response.data[i].id, - // name: response.data[i].name, - // step: response.data[i].step, - // score: response.data[i].score, - // user_id: user_id, - // assignment_id: assignment_id, - // lecture_id: lecture_id, - // isProfessor: isProfessor, - // } as SubmitterPropType); - // console.log(tmpList) - // } - // setSubmittersPropsList(tmpList); - setSubmittersPropsList(response.data) + //기존 코드로 인해 list에 값이 중복으로 들어가게 되므로 삭제 + for (let i = 0; i < response.data.length; i++) { + tmpList.push({ + id: response.data[i].id, + name: response.data[i].name, + step: response.data[i].step, + score: response.data[i].score, + user_id: user_id, + assignment_id: assignment_id, + lecture_id: lecture_id, + isProfessor: isProfessor, + } as SubmitterPropType); + console.log(tmpList) + } + setSubmittersPropsList(tmpList); + //setSubmittersPropsList(response.data) } else { // 학생 것만 보이게 for (let i = 0; i < response.data.length; i++) { @@ -96,10 +96,10 @@ const Submit: FC = () => { console.log("자동채점 api 호출") }); }); - } + } + }); }); - }); - }; + }; return ( <>