fix(M02): 층 길 목록 모양 · 프로젝트 층 표는 설계값 채운 문서로 보임 (PLAN 10-1)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0148XFUpPfpiuTjxF1EK9c95
This commit is contained in:
2026-09-25 10:02:43 +09:00
co-authored by Claude Sonnet 5
parent 910ea06930
commit 31c9fb6c61
2 changed files with 28 additions and 5 deletions
@@ -20,7 +20,8 @@ export interface TemplateInfo {
export interface TemplateDoc {
종류: Kind;
이름: string;
판: string;
/** 프로젝트 층에서 작업본이 아직 없으면(옛 프로젝트) 시스템 양식이 와서 null */
판: string | null;
문서: unknown;
}
@@ -49,8 +50,16 @@ const head = (layer: Layer): string =>
const item = (layer: Layer, kind: Kind, name: string, projectId: string | null): string =>
`${head(layer)}/${kind}/${enc(name)}${layer === "system" ? "" : q(projectId)}`;
export const listTemplates = (layer: Layer, projectId: string | null): Promise<TemplateInfo[]> =>
call(layer === "system" ? head(layer) : `${head(layer)}${q(projectId)}`);
/** 시스템 길은 배열 · 층 길은 `{층, 양식: [...]}` — 둘 다 목록으로 */
export const listTemplates = async (
layer: Layer,
projectId: string | null,
): Promise<TemplateInfo[]> => {
const got = await call<TemplateInfo[] | { 양식: TemplateInfo[] }>(
layer === "system" ? head(layer) : `${head(layer)}${q(projectId)}`,
);
return Array.isArray(got) ? got : got.양식;
};
export const readTemplate = (
layer: Layer,
@@ -103,3 +112,7 @@ export interface SourceItem {
}
export const fetchSources = (id: string): Promise<unknown> => call(`/projects/${enc(id)}/sources`);
/** 설계값을 채운 표 문서 — 서버가 그때그때 채움 · 저장 안 함 */
export const readFilled = (id: string, name: string): Promise<TemplateDoc> =>
call(`/projects/${enc(id)}/tables/${enc(name)}/filled`);