fix(frontend): getUpcomingSchedules에 flattenScheduleResponse 적용

- 백엔드 응답(날짜별 그룹 객체)을 배열로 변환
- 필드명 snake_case 통일 (category_id, category_name, category_color)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
caadiq 2026-01-21 20:24:51 +09:00
parent 6a6f45798a
commit d660340cc5

View file

@ -16,9 +16,9 @@ function flattenScheduleResponse(data) {
schedules.push({
...schedule,
date,
categoryId: category.id,
categoryName: category.name,
categoryColor: category.color,
category_id: category.id,
category_name: category.name,
category_color: category.color,
});
}
}
@ -40,7 +40,8 @@ export async function getSchedules(year, month) {
*/
export async function getUpcomingSchedules(limit = 3) {
const today = getTodayKST();
return fetchApi(`/schedules?startDate=${today}&limit=${limit}`);
const data = await fetchApi(`/schedules?startDate=${today}&limit=${limit}`);
return flattenScheduleResponse(data);
}
/**