From e3d438965a507ede2cbdf458adbafb554b9b7df9 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Thu, 1 Oct 2026 09:56:15 +0900 Subject: [PATCH] =?UTF-8?q?fix(m01-easycalc):=20Pick=20=EC=9E=AC=EB=A3=8C?= =?UTF-8?q?=20=ED=9B=84=EB=B3=B4=20=ED=83=80=EC=9E=85=20=EC=A0=95=EB=A6=AC?= =?UTF-8?q?=20=E2=80=94=20ElementBrief=20=EA=B5=AC=EB=B6=84=20=EC=B9=B8=20?= =?UTF-8?q?=ED=83=80=EC=9E=85=20=EB=B9=A8=EA=B0=95=20=ED=95=B4=EC=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_019ACSGaHdLgnkEkoA4LDtMU --- M01_MasterData/EasyCalc/M01_EasyCalc_Pick.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/M01_MasterData/EasyCalc/M01_EasyCalc_Pick.ts b/M01_MasterData/EasyCalc/M01_EasyCalc_Pick.ts index 570e67dda..bc0258535 100644 --- a/M01_MasterData/EasyCalc/M01_EasyCalc_Pick.ts +++ b/M01_MasterData/EasyCalc/M01_EasyCalc_Pick.ts @@ -15,12 +15,14 @@ import { } from "@ui/ui_template_elements"; import { openModal } from "@ui/ui_template_modal"; import { fetchPick, fetchSubs, type SubInfo } from "../M01_MasterData_Api_Fetch"; -import { fetchMaterials } from "../M01_MasterData_UI_Logic_Api"; +import { fetchMaterials, type ElementBrief } from "../M01_MasterData_UI_Logic_Api"; import { listEasy, listMachines, machineElement, plainError } from "./M01_EasyCalc_Api"; import type { PickResult } from "./M01_EasyCalc_Model"; import "./M01_EasyCalc_Pick.css"; type Kind = PickResult["kind"]; +/** 후보 줄 — 서버는 구분 · 상세구분도 주지만 ElementBrief 타입에는 없음 */ +type Brief = ElementBrief & { 구분?: string; 상세구분?: string }; const TEXT = { Title: ["넣을 것 고르기", "Pick what to add"], @@ -136,13 +138,13 @@ const SOURCES: Partial> = { ? await fetchPick("price", f.q).then((r) => ({ total: r.total, items: r.items - .filter((it) => !f.sub || (it as { 구분?: string }).구분 === f.sub) - .map((it) => ({ ...it, 구분: (it as { 구분?: string }).구분, 상세구분: undefined })), + .filter((it) => !f.sub || (it as Brief).구분 === f.sub) + .map((it) => ({ ...it, 구분: (it as Brief).구분 })), })) : await fetchMaterials({ sub: f.sub, ...(f.detail ? { detail: f.detail } : {}) }).then( (r) => ({ total: r.total, - items: r.items.map((it) => ({ ...it, 구분: it.구분 ?? f.sub })), + items: r.items.map((it) => ({ ...it, 구분: (it as Brief).구분 ?? f.sub })), }), ); return { @@ -153,7 +155,7 @@ const SOURCES: Partial> = { const unit = typeof it.단위 === "string" ? it.단위 : ""; const price = num(it.값); const element: Record = { 구분: it.구분 ?? f.sub }; - const detail = (it as { 상세구분?: string }).상세구분; + const detail = (it as Brief).상세구분; if (detail) element["상세구분"] = detail; element["검색어"] = `${name} ${spec}`.trim(); return {