Skip to content

Commit

Permalink
refactor: 수강생 페이지네이션 DTO 네이밍 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
hamo-o committed Nov 10, 2024
1 parent 6dc8c9b commit 0d094b3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions apps/admin/apis/study/studyApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
import type { AttendanceApiResponseDto } from "types/dtos/attendance";
import type { CurriculumApiResponseDto } from "types/dtos/curriculumList";
import type { StudyBasicInfoApiResponseDto } from "types/dtos/studyBasicInfo";
import type { PageStudyStudentApiResponseDto } from "types/dtos/studyStudent";
import type { PaginatedStudyStudentResponseDto } from "types/dtos/studyStudent";
import type { PageableType } from "types/entities/page";
import type { StudyAnnouncementType } from "types/entities/study";

Expand Down Expand Up @@ -151,7 +151,7 @@ export const studyApi = {
return response.data;
},
getStudyStudents: async (studyId: number, pageable: PageableType) => {
const response = await fetcher.get<PageStudyStudentApiResponseDto>(
const response = await fetcher.get<PaginatedStudyStudentResponseDto>(
`/mentor/studies/${studyId}/students`,
{
next: { tags: [tags.students] },
Expand Down
4 changes: 2 additions & 2 deletions apps/admin/app/students/_components/StudentPagination.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { PageStudyStudentApiResponseDto } from "types/dtos/studyStudent";
import type { PaginatedStudyStudentResponseDto } from "types/dtos/studyStudent";
import Pagination from "wowds-ui/Pagination";

const StudentPagination = ({
pageInfo,
handleClickChangePage,
}: {
pageInfo: Omit<PageStudyStudentApiResponseDto, "content"> | null;
pageInfo: Omit<PaginatedStudyStudentResponseDto, "content"> | null;
handleClickChangePage: (nextPage: number) => void;
}) => {
if (!pageInfo || !pageInfo.numberOfElements) return null;
Expand Down
6 changes: 3 additions & 3 deletions apps/admin/hooks/fetch/useFetchStudents.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { studyApi } from "apis/study/studyApi";
import { useEffect, useState } from "react";
import type {
PageStudyStudentApiResponseDto,
PaginatedStudyStudentResponseDto,
StudyStudentApiResponseDto,
} from "types/dtos/studyStudent";

Expand All @@ -14,13 +14,13 @@ const useFetchStudents = (
page: number
): {
studentList: StudyStudentApiResponseDto[] | [];
pageInfo: Omit<PageStudyStudentApiResponseDto, "content"> | null;
pageInfo: Omit<PaginatedStudyStudentResponseDto, "content"> | null;
} => {
const [studentList, setStudentList] = useState<
StudyStudentApiResponseDto[] | []
>([]);
const [pageInfo, setPageInfo] = useState<Omit<
PageStudyStudentApiResponseDto,
PaginatedStudyStudentResponseDto,
"content"
> | null>(null);

Expand Down
2 changes: 1 addition & 1 deletion apps/admin/types/dtos/studyStudent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface StudyStudentApiResponseDto {
attendanceRate: number;
}

export interface PageStudyStudentApiResponseDto {
export interface PaginatedStudyStudentResponseDto {
totalElements: number;
totalPages: number;
size: number;
Expand Down

0 comments on commit 0d094b3

Please sign in to comment.