diff --git a/src/components/business/construction/estimates/actions.ts b/src/components/business/construction/estimates/actions.ts index ab5eddb1..44e5f5d1 100644 --- a/src/components/business/construction/estimates/actions.ts +++ b/src/components/business/construction/estimates/actions.ts @@ -667,15 +667,21 @@ export async function getExpenseItemOptions(): Promise<{ }> { try { const response = await apiClient.get<{ - data: Array<{ - id: number; - code: string; - name: string; - unit: string | null; - item_type: string; - is_active: boolean; - }>; - meta?: { total: number }; + success: boolean; + message: string; + data: { + data: Array<{ + id: number; + code: string; + name: string; + unit: string | null; + item_type: string; + is_active: boolean; + }>; + current_page: number; + per_page: number; + total: number; + }; }>('/items', { params: { item_type: 'RM', // 공과 품목만 조회 @@ -684,7 +690,9 @@ export async function getExpenseItemOptions(): Promise<{ }, }); - const items = Array.isArray(response.data) ? response.data : []; + // API 응답: { success, message, data: { data: [...items], current_page, ... } } + const paginatedData = response.data; + const items = Array.isArray(paginatedData.data) ? paginatedData.data : []; const options: ExpenseItemOption[] = items.map((item) => ({ value: String(item.id), label: item.name,