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:
parent
6a6f45798a
commit
d660340cc5
1 changed files with 5 additions and 4 deletions
|
|
@ -16,9 +16,9 @@ function flattenScheduleResponse(data) {
|
||||||
schedules.push({
|
schedules.push({
|
||||||
...schedule,
|
...schedule,
|
||||||
date,
|
date,
|
||||||
categoryId: category.id,
|
category_id: category.id,
|
||||||
categoryName: category.name,
|
category_name: category.name,
|
||||||
categoryColor: category.color,
|
category_color: category.color,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -40,7 +40,8 @@ export async function getSchedules(year, month) {
|
||||||
*/
|
*/
|
||||||
export async function getUpcomingSchedules(limit = 3) {
|
export async function getUpcomingSchedules(limit = 3) {
|
||||||
const today = getTodayKST();
|
const today = getTodayKST();
|
||||||
return fetchApi(`/schedules?startDate=${today}&limit=${limit}`);
|
const data = await fetchApi(`/schedules?startDate=${today}&limit=${limit}`);
|
||||||
|
return flattenScheduleResponse(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue