From d22a25514303d72b18fc24e9cd0aa99c0859a54f Mon Sep 17 00:00:00 2001 From: rsone001 Date: Wed, 14 Oct 2026 17:35:32 +0900 Subject: [PATCH] =?UTF-8?q?[ST]=20-=20fix:=20type=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../management/StatisticsPopulationManagement.tsx | 9 ++++----- .../management/hooks/usePopulationMappingTab.ts | 2 +- .../management/types/population-tab-types.ts | 12 +++++------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/apps/st/src/components/statistics/management/StatisticsPopulationManagement.tsx b/apps/st/src/components/statistics/management/StatisticsPopulationManagement.tsx index d2005b437..dd59482c6 100644 --- a/apps/st/src/components/statistics/management/StatisticsPopulationManagement.tsx +++ b/apps/st/src/components/statistics/management/StatisticsPopulationManagement.tsx @@ -46,11 +46,10 @@ const StatisticsPopulationManagement = () => { const foreignTab = usePopulationMappingTab({ kind: "foreign", - getList: async (statsYr, opt1) => { - const res = await statisticsPpltnApi.getForeignPopulationList(statsYr, opt1); - // res.data를 확실하게 ForeignPopulationItem[]로 캐스팅 - return { ...res, data: res.data as ForeignPopulationItem[] }; -}, + getList: async (statsYr, opt1) => { + const res = await statisticsPpltnApi.getForeignPopulationList(statsYr, opt1); + return { ...res, data: (res.data ?? []) as ForeignPopulationItem[] }; + }, uploadExcel: statisticsPpltnApi.uploadForeignPopulationExcel, saveFinal: statisticsPpltnApi.saveForeignPopulationFinal, getUpperCodesByName: statisticsPpltnApi.getUpperCodesByName, diff --git a/apps/st/src/components/statistics/management/hooks/usePopulationMappingTab.ts b/apps/st/src/components/statistics/management/hooks/usePopulationMappingTab.ts index fa5319994..7321753de 100644 --- a/apps/st/src/components/statistics/management/hooks/usePopulationMappingTab.ts +++ b/apps/st/src/components/statistics/management/hooks/usePopulationMappingTab.ts @@ -131,7 +131,7 @@ export function usePopulationMappingTab( statsYr, admdstCd: String(row.admdstCd ?? ""), admdstNm: String(row.admdstNm ?? ""), - sbstAdmdstCd: String(row.sbstAdmdstCd ?? ""), + subAdmdstCd: String(row.sbstAdmdstCd ?? ""), })); const res = await config.saveFinal(statsYr, regList); diff --git a/apps/st/src/components/statistics/management/types/population-tab-types.ts b/apps/st/src/components/statistics/management/types/population-tab-types.ts index 70f82b121..ef819a160 100644 --- a/apps/st/src/components/statistics/management/types/population-tab-types.ts +++ b/apps/st/src/components/statistics/management/types/population-tab-types.ts @@ -1,4 +1,7 @@ -import type { UpperCodeCandidateItem } from "@/entities/statistics/model/ppltn/statistics-domestic-population-interface"; +import type { + DomesticPopulationMappingItem, + UpperCodeCandidateItem, +} from "@/entities/statistics/model/ppltn/statistics-domestic-population-interface"; import type { ApiResponse } from "@/entities/statistics/model/statistics-interface"; /* ══════════════════════════════════════════════════ @@ -84,12 +87,7 @@ export type PopulationStatusListResponse = ApiResponse; export type MappingTabKind = "domestic" | "foreign"; /** 반영(최종 매핑 저장) 요청 시 서버로 보내는 단건 페이로드 - 내국인/외국인 공통 */ -export interface PopulationMappingRegItem { - statsYr: string; - admdstCd: string; - admdstNm: string; - sbstAdmdstCd: string; -} +export type PopulationMappingRegItem = DomesticPopulationMappingItem; /** 좌/우 그리드 행이 공통으로 가져야 하는 최소 필드 */ export interface PopulationMappingRow {