diff --git a/M01_MasterData/EasyCalc/M01_EasyCalc_Pick.ts b/M01_MasterData/EasyCalc/M01_EasyCalc_Pick.ts index e08cb5e85..a7b9bc8cb 100644 --- a/M01_MasterData/EasyCalc/M01_EasyCalc_Pick.ts +++ b/M01_MasterData/EasyCalc/M01_EasyCalc_Pick.ts @@ -137,10 +137,12 @@ const SOURCES: Partial> = { .filter((it) => !f.sub || (it as { 구분?: string }).구분 === f.sub) .map((it) => ({ ...it, 구분: (it as { 구분?: string }).구분, 상세구분: undefined })), })) - : await fetchMaterials({ sub: f.sub, detail: f.detail || undefined }).then((r) => ({ - total: r.total, - items: r.items.map((it) => ({ ...it, 구분: it.구분 ?? f.sub })), - })); + : await fetchMaterials({ sub: f.sub, ...(f.detail ? { detail: f.detail } : {}) }).then( + (r) => ({ + total: r.total, + items: r.items.map((it) => ({ ...it, 구분: it.구분 ?? f.sub })), + }), + ); return { total: found.total, items: found.items.map((it) => { @@ -149,7 +151,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 }).상세구분 ?? f.detail; + const detail = (it as { 상세구분?: string }).상세구분; if (detail) element["상세구분"] = detail; element["검색어"] = `${name} ${spec}`.trim(); return {