Skip to content

Commit

Permalink
fix: 타입 에러 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hamo-o committed Nov 4, 2024
1 parent 5d08579 commit c866ee5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion apps/admin/app/students/_components/StudentList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const StudentList = ({
};

const StudentListItem = ({
memberId,
studyHistoryStatus,
isFirstRoundOutstandingStudent,
isSecondRoundOutstandingStudent,
Expand All @@ -66,7 +67,7 @@ const StudentListItem = ({
attendanceRate,
}: StudyStudentApiResponseDto) => {
return (
<Table.Tr key={studentId} value={studentId}>
<Table.Tr key={memberId}>
<Table.Td>
<StarCheckIcon checked={studyHistoryStatus === "COMPLETED"} />
</Table.Td>
Expand Down
2 changes: 1 addition & 1 deletion apps/admin/app/students/_components/StudentPagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const StudentPagination = ({
pageInfo,
handleClickChangePage,
}: {
pageInfo: Omit<PageStudyStudentApiResponseDto, "content">;
pageInfo: Omit<PageStudyStudentApiResponseDto, "content"> | null;
handleClickChangePage: (nextPage: number) => void;
}) => {
if (!pageInfo || !pageInfo.numberOfElements) return null;
Expand Down
2 changes: 1 addition & 1 deletion apps/admin/app/students/_components/StudentsHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const StudentsHeader = ({
studentLength,
}: {
studyList: StudyListApiResponseDto[];
studyId?: number;
studyId: number;
studentLength: number;
}) => {
const [url, setUrl] = useState<string>("");
Expand Down
6 changes: 5 additions & 1 deletion apps/admin/app/students/_components/TaskTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { attendanceTaskStatusMap } from "constants/status/attendanceStatusMap";
import type { StudyTaskResponseDto } from "types/dtos/studyStudent";
import Tag from "wowds-ui/Tag";

const TaskTag = ({ task }: { task: StudyTaskResponseDto }) => {
const TaskTag = ({
task,
}: {
task: StudyTaskResponseDto<"ASSIGNMENT" | "ATTENDANCE">;
}) => {
const { taskType } = task;
if (taskType === "ATTENDANCE") {
const { attendanceStatus } = task;
Expand Down
8 changes: 5 additions & 3 deletions apps/admin/hooks/fetch/useFetchStudents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ const useFetchStudents = (
page: number
): {
studentList: StudyStudentApiResponseDto[] | [];
pageInfo: Omit<PageStudyStudentApiResponseDto, "content">;
pageInfo: Omit<PageStudyStudentApiResponseDto, "content"> | null;
} => {
const [studentList, setStudentList] = useState<
StudyStudentApiResponseDto[] | []
>([]);
const [pageInfo, setPageInfo] =
useState<Omit<PageStudyStudentApiResponseDto, "content">>(null);
const [pageInfo, setPageInfo] = useState<Omit<
PageStudyStudentApiResponseDto,
"content"
> | null>(null);

useEffect(() => {
const fetchStudentsData = async () => {
Expand Down

0 comments on commit c866ee5

Please sign in to comment.