From 09dab866d93ab06a5456eea3409471b9195ef84f Mon Sep 17 00:00:00 2001 From: leejin_rho Date: Tue, 2 Jul 2024 16:40:49 +0900 Subject: [PATCH 1/3] =?UTF-8?q?#29=20fix:=20=EC=BA=98=EB=A6=B0=EB=8D=94=20?= =?UTF-8?q?=EB=A1=9C=EB=94=A9=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/hooks/calendar.ts | 4 ++-- components/calendar/CalendarModal.tsx | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apis/hooks/calendar.ts b/apis/hooks/calendar.ts index b615fb2..0980ad1 100644 --- a/apis/hooks/calendar.ts +++ b/apis/hooks/calendar.ts @@ -10,11 +10,11 @@ const useGetMonthCalendar = () => { }; const useGetProgramDetail = (programIdx: number) => { - const { data } = useQuery({ + const { data, isLoading } = useQuery({ queryKey: ["getProgramDetail"], queryFn: () => getProgramDetail(programIdx), }); - return { data }; + return { data, isLoading }; }; export { useGetMonthCalendar, useGetProgramDetail }; diff --git a/components/calendar/CalendarModal.tsx b/components/calendar/CalendarModal.tsx index b674478..13da89d 100644 --- a/components/calendar/CalendarModal.tsx +++ b/components/calendar/CalendarModal.tsx @@ -9,9 +9,13 @@ const CalendarModal = ({ programIdx: number; toggleModal: () => void; }) => { - const { data }: { data: GetProgramDetailBody } = + const { data, isLoading }: { data: GetProgramDetailBody } = useGetProgramDetail(programIdx); + if (isLoading) { + return
Loading...
; + } + return ( data && (
Date: Tue, 2 Jul 2024 16:41:27 +0900 Subject: [PATCH 2/3] =?UTF-8?q?#29=20fix:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?console.log=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/login.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/pages/login.tsx b/pages/login.tsx index 865f232..0701ea9 100644 --- a/pages/login.tsx +++ b/pages/login.tsx @@ -54,7 +54,6 @@ const Login: NextPage = () => { mutationKey: ["SignIn"], mutationFn: SignIn, onSuccess: async (data) => { - console.log(data); const accessToken = data.result.accessToken; const refreshToken = data.result.refreshToken; const isAdmin = data.result.isAdmin; From 69efea36ed1d3364d66b06c5f9164c15a4539cd6 Mon Sep 17 00:00:00 2001 From: leejin_rho Date: Tue, 2 Jul 2024 16:44:07 +0900 Subject: [PATCH 3/3] =?UTF-8?q?#29=20fix:=20data=20=EC=98=A4=EB=A5=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/calendar/CalendarModal.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/calendar/CalendarModal.tsx b/components/calendar/CalendarModal.tsx index 13da89d..05da038 100644 --- a/components/calendar/CalendarModal.tsx +++ b/components/calendar/CalendarModal.tsx @@ -9,8 +9,7 @@ const CalendarModal = ({ programIdx: number; toggleModal: () => void; }) => { - const { data, isLoading }: { data: GetProgramDetailBody } = - useGetProgramDetail(programIdx); + const { data, isLoading } = useGetProgramDetail(programIdx); if (isLoading) { return
Loading...
;