fix(M02): 도면 양식 저장이 빈 {} 로 덮이던 흠 — getDoc 을 await · 서버는 뼈대 없는 문서를 400 으로 거절

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 12:43:03 +09:00
co-authored by Claude Sonnet 5
parent dd60b6a1cb
commit 9bf3258509
3 changed files with 28 additions and 5 deletions
@@ -23,7 +23,7 @@ export interface Selection {
}
interface EditorHandle {
getDoc: () => unknown;
getDoc: () => unknown | Promise<unknown>;
destroy: () => void;
}
@@ -162,7 +162,7 @@ export function createMain(isAdmin: boolean): MainHandle {
if (!sel) return;
const at = sel;
try {
const doc = editor ? editor.getDoc() : loaded;
const doc = editor ? await editor.getDoc() : loaded;
const info = await saveTemplate(at.layer, at.kind, at.name, at.projectId, version, doc);
version = info.판;
loaded = doc;