From c6281d0559f16bcf3533559b9f32e6c3d35a761c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Thu, 26 Feb 2026 14:29:22 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[calendar]=20=EB=8B=AC=EB=A0=A5=20?= =?UTF-8?q?=EC=9D=BC=EC=A0=95=20=EA=B4=80=EB=A6=AC=20API=20=EC=97=B0?= =?UTF-8?q?=EB=8F=99=20=ED=99=9C=EC=84=B1=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - loadData 함수의 API 호출 주석 해제 - getCalendarSchedules, getCalendarStats 실제 호출 --- .../hr/CalendarManagement/index.tsx | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/src/components/hr/CalendarManagement/index.tsx b/src/components/hr/CalendarManagement/index.tsx index a17c1d9f..5c401c0c 100644 --- a/src/components/hr/CalendarManagement/index.tsx +++ b/src/components/hr/CalendarManagement/index.tsx @@ -69,25 +69,23 @@ export function CalendarManagement() { }); const loadData = useCallback(async () => { - // TODO: 백엔드 API 구현 후 아래 주석 해제 - // setIsLoading(true); - // try { - // const [schedulesResult, statsResult] = await Promise.all([ - // getCalendarSchedules(year), - // getCalendarStats(year), - // ]); - // const loadedSchedules = schedulesResult.success && schedulesResult.data ? schedulesResult.data : []; - // setSchedules(loadedSchedules); - // if (statsResult.success && statsResult.data) { - // setStats(statsResult.data); - // } - // useCalendarScheduleStore.getState().setSchedulesForYear(year, loadedSchedules); - // } catch { - // // API 엔드포인트 미구현 시 조용히 실패 - // } finally { - // setIsLoading(false); - // } - setIsLoading(false); + setIsLoading(true); + try { + const [schedulesResult, statsResult] = await Promise.all([ + getCalendarSchedules(year), + getCalendarStats(year), + ]); + const loadedSchedules = schedulesResult.success && schedulesResult.data ? schedulesResult.data : []; + setSchedules(loadedSchedules); + if (statsResult.success && statsResult.data) { + setStats(statsResult.data); + } + useCalendarScheduleStore.getState().setSchedulesForYear(year, loadedSchedules); + } catch { + // 조회 실패 시 빈 상태 유지 + } finally { + setIsLoading(false); + } }, [year]); useEffect(() => {