fix(m01-easycalc): Pick 재료 상세구분 빈 값 보냄 고침 · 검색 결과 상세구분 안 붙임
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ACSGaHdLgnkEkoA4LDtMU
This commit is contained in:
@@ -137,10 +137,12 @@ const SOURCES: Partial<Record<Kind, Source>> = {
|
||||
.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<Record<Kind, Source>> = {
|
||||
const unit = typeof it.단위 === "string" ? it.단위 : "";
|
||||
const price = num(it.값);
|
||||
const element: Record<string, string> = { 구분: it.구분 ?? f.sub };
|
||||
const detail = (it as { 상세구분?: string }).상세구분 ?? f.detail;
|
||||
const detail = (it as { 상세구분?: string }).상세구분;
|
||||
if (detail) element["상세구분"] = detail;
|
||||
element["검색어"] = `${name} ${spec}`.trim();
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user