From 0d094b37dc07b45d4e96ce8439528b144c3f9034 Mon Sep 17 00:00:00 2001 From: hamo-o Date: Sun, 10 Nov 2024 16:59:11 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=88=98=EA=B0=95=EC=83=9D=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EB=84=A4=EC=9D=B4=EC=85=98=20DTO=20?= =?UTF-8?q?=EB=84=A4=EC=9D=B4=EB=B0=8D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/admin/apis/study/studyApi.ts | 4 ++-- apps/admin/app/students/_components/StudentPagination.tsx | 4 ++-- apps/admin/hooks/fetch/useFetchStudents.ts | 6 +++--- apps/admin/types/dtos/studyStudent.ts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/admin/apis/study/studyApi.ts b/apps/admin/apis/study/studyApi.ts index 4bad8934..0ca28ce8 100644 --- a/apps/admin/apis/study/studyApi.ts +++ b/apps/admin/apis/study/studyApi.ts @@ -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"; @@ -151,7 +151,7 @@ export const studyApi = { return response.data; }, getStudyStudents: async (studyId: number, pageable: PageableType) => { - const response = await fetcher.get( + const response = await fetcher.get( `/mentor/studies/${studyId}/students`, { next: { tags: [tags.students] }, diff --git a/apps/admin/app/students/_components/StudentPagination.tsx b/apps/admin/app/students/_components/StudentPagination.tsx index 5848dd17..5c40cd19 100644 --- a/apps/admin/app/students/_components/StudentPagination.tsx +++ b/apps/admin/app/students/_components/StudentPagination.tsx @@ -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 | null; + pageInfo: Omit | null; handleClickChangePage: (nextPage: number) => void; }) => { if (!pageInfo || !pageInfo.numberOfElements) return null; diff --git a/apps/admin/hooks/fetch/useFetchStudents.ts b/apps/admin/hooks/fetch/useFetchStudents.ts index 92eb1471..43296d8d 100644 --- a/apps/admin/hooks/fetch/useFetchStudents.ts +++ b/apps/admin/hooks/fetch/useFetchStudents.ts @@ -1,7 +1,7 @@ import { studyApi } from "apis/study/studyApi"; import { useEffect, useState } from "react"; import type { - PageStudyStudentApiResponseDto, + PaginatedStudyStudentResponseDto, StudyStudentApiResponseDto, } from "types/dtos/studyStudent"; @@ -14,13 +14,13 @@ const useFetchStudents = ( page: number ): { studentList: StudyStudentApiResponseDto[] | []; - pageInfo: Omit | null; + pageInfo: Omit | null; } => { const [studentList, setStudentList] = useState< StudyStudentApiResponseDto[] | [] >([]); const [pageInfo, setPageInfo] = useState | null>(null); diff --git a/apps/admin/types/dtos/studyStudent.ts b/apps/admin/types/dtos/studyStudent.ts index 38da75d2..5ba49468 100644 --- a/apps/admin/types/dtos/studyStudent.ts +++ b/apps/admin/types/dtos/studyStudent.ts @@ -21,7 +21,7 @@ export interface StudyStudentApiResponseDto { attendanceRate: number; } -export interface PageStudyStudentApiResponseDto { +export interface PaginatedStudyStudentResponseDto { totalElements: number; totalPages: number; size: number;