From 25cf0b77a105ec005f329c70ec4d0b6a1d297f29 Mon Sep 17 00:00:00 2001 From: dohyeons Date: Mon, 13 Oct 2025 15:15:59 +0900 Subject: [PATCH] =?UTF-8?q?=ED=94=84=EB=A1=A0=ED=8A=B8=EC=97=94=EB=93=9C?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EB=B0=B1=EC=97=94=EB=93=9C=EA=B0=80=20?= =?UTF-8?q?=EA=B8=B0=EB=8C=80=ED=95=98=EB=8A=94=20=ED=98=95=EC=8B=9D?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B3=80=ED=99=98=ED=95=B4=EC=84=9C=20?= =?UTF-8?q?=EB=B3=B4=EB=82=B4=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/contexts/ReportDesignerContext.tsx | 38 ++++++++++++++++----- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/frontend/contexts/ReportDesignerContext.tsx b/frontend/contexts/ReportDesignerContext.tsx index 5c82c18a..8244cfd1 100644 --- a/frontend/contexts/ReportDesignerContext.tsx +++ b/frontend/contexts/ReportDesignerContext.tsx @@ -1426,14 +1426,36 @@ export function ReportDesignerProvider({ reportId, children }: { reportId: strin window.history.replaceState({}, "", `/admin/report/designer/${actualReportId}`); } - // 레이아웃 저장 (페이지 구조로) - await reportApi.saveLayout(actualReportId, { - layoutConfig, // 페이지 기반 구조 - queries: queries.map((q) => ({ - ...q, - externalConnectionId: q.externalConnectionId || undefined, - })), - }); + // 백엔드 호환성을 위해 첫 번째 페이지 정보를 레거시 필드로 변환 + const firstPage = layoutConfig.pages[0]; + const legacyFormat = firstPage + ? { + canvasWidth: firstPage.width, + canvasHeight: firstPage.height, + pageOrientation: firstPage.orientation, + components: firstPage.components, + margins: firstPage.margins, + // 새로운 페이지 기반 구조도 함께 전송 + layoutConfig, + queries: queries.map((q) => ({ + ...q, + externalConnectionId: q.externalConnectionId || undefined, + })), + } + : { + canvasWidth: 210, + canvasHeight: 297, + pageOrientation: "portrait" as const, + components: [], + layoutConfig, + queries: queries.map((q) => ({ + ...q, + externalConnectionId: q.externalConnectionId || undefined, + })), + }; + + // 레이아웃 저장 + await reportApi.saveLayout(actualReportId, legacyFormat); toast({ title: "성공",