fix(M02): 저장 직후 지우기가 409 로 거절되던 흠 — 저장 뒤 좌측 목록 다시 읽음 · 지우기 전에도 최신 판으로

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 13:03:01 +09:00
co-authored by Claude Sonnet 5
parent acca7d1fb6
commit 2aa4c80577
3 changed files with 4 additions and 2 deletions
@@ -55,7 +55,7 @@ export function canEdit(layer: Layer, isAdmin: boolean): boolean {
return layer === "project" || layer === "personal" || (layer === "system" && isAdmin);
}
export function createMain(isAdmin: boolean): MainHandle {
export function createMain(isAdmin: boolean, onSaved?: () => void): MainHandle {
const title = el("h2", { className: "m02-main__title", text: L("M02_PickTemplate") });
const reload = createButton({ label: L("M02_Reload"), variant: "ghost" });
const save = createButton({ label: L("M02_Save"), variant: "filled" });
@@ -168,6 +168,7 @@ export function createMain(isAdmin: boolean): MainHandle {
loaded = doc;
showNotice([]);
showToast(L("M02_Saved"), "success");
onSaved?.(); // 좌측 목록의 판을 새 판으로
} catch (error) {
if (error instanceof StaleError) {
const again = createButton({ label: L("M02_Reload"), variant: "ghost" });
@@ -17,7 +17,7 @@ import "./M02_MasterTemplete_UI_Style.css";
export async function renderM02MasterTemplate(root: HTMLElement): Promise<void> {
const user = await fetchSessionUser().catch(() => null);
const isAdmin = user?.role === "SYSTEM_ADMIN";
const main = createMain(isAdmin);
const main = createMain(isAdmin, () => void side.refresh());
const side = buildSide({
isAdmin,
userName: user?.name,
@@ -334,6 +334,7 @@ export function buildSide(opt: SideOptions): SideHandle {
});
});
btnDel.addEventListener("click", async () => {
await refresh(); // 저장 직후여도 최신 판으로
const info = currentInfo();
if (!info) return;
if (!(await showConfirmDialog(L("M02_DeleteConfirm").replace("{value}", info.이름)))) return;