대시보드 에러 해결
This commit is contained in:
@@ -157,6 +157,13 @@ export default function DashboardDesigner({ dashboardId: initialDashboardId }: D
|
||||
const { dashboardApi } = await import("@/lib/api/dashboard");
|
||||
const dashboard = await dashboardApi.getDashboard(id);
|
||||
|
||||
console.log("🔍 [loadDashboard] 대시보드 응답:", {
|
||||
id: dashboard.id,
|
||||
title: dashboard.title,
|
||||
settingsType: typeof (dashboard as any).settings,
|
||||
settingsValue: (dashboard as any).settings,
|
||||
});
|
||||
|
||||
// 대시보드 정보 설정
|
||||
setDashboardId(dashboard.id);
|
||||
setDashboardTitle(dashboard.title);
|
||||
@@ -164,6 +171,12 @@ export default function DashboardDesigner({ dashboardId: initialDashboardId }: D
|
||||
// 저장된 설정 복원
|
||||
const settings = (dashboard as { settings?: { resolution?: Resolution; backgroundColor?: string } }).settings;
|
||||
|
||||
console.log("🔍 [loadDashboard] 파싱된 settings:", {
|
||||
settings,
|
||||
resolution: settings?.resolution,
|
||||
backgroundColor: settings?.backgroundColor,
|
||||
});
|
||||
|
||||
// 배경색 설정
|
||||
if (settings?.backgroundColor) {
|
||||
setCanvasBackgroundColor(settings.backgroundColor);
|
||||
@@ -171,6 +184,7 @@ export default function DashboardDesigner({ dashboardId: initialDashboardId }: D
|
||||
|
||||
// 해상도와 요소를 함께 설정 (해상도가 먼저 반영되어야 함)
|
||||
const loadedResolution = settings?.resolution || "fhd";
|
||||
console.log("🔍 [loadDashboard] 로드할 resolution:", loadedResolution);
|
||||
setResolution(loadedResolution);
|
||||
|
||||
// 요소들 설정
|
||||
@@ -457,6 +471,11 @@ export default function DashboardDesigner({ dashboardId: initialDashboardId }: D
|
||||
},
|
||||
};
|
||||
|
||||
console.log("🔍 [handleSave] 업데이트 데이터:", {
|
||||
dashboardId,
|
||||
settings: updateData.settings,
|
||||
});
|
||||
|
||||
savedDashboard = await dashboardApi.updateDashboard(dashboardId, updateData);
|
||||
} else {
|
||||
// 새 대시보드 생성
|
||||
@@ -471,6 +490,10 @@ export default function DashboardDesigner({ dashboardId: initialDashboardId }: D
|
||||
},
|
||||
};
|
||||
|
||||
console.log("🔍 [handleSave] 생성 데이터:", {
|
||||
settings: dashboardData.settings,
|
||||
});
|
||||
|
||||
savedDashboard = await dashboardApi.createDashboard(dashboardData);
|
||||
setDashboardId(savedDashboard.id);
|
||||
}
|
||||
|
||||
@@ -162,3 +162,4 @@ export function getAllDescendants(
|
||||
return descendants;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user