대시보드 복제 기능 구현
This commit is contained in:
parent
317b4ed1e7
commit
7155f76345
|
|
@ -67,13 +67,17 @@ export default function DashboardListPage() {
|
|||
// 대시보드 복사
|
||||
const handleCopy = async (dashboard: Dashboard) => {
|
||||
try {
|
||||
// 전체 대시보드 정보(요소 포함)를 가져오기
|
||||
const fullDashboard = await dashboardApi.getDashboard(dashboard.id);
|
||||
|
||||
const newDashboard = await dashboardApi.createDashboard({
|
||||
title: `${dashboard.title} (복사본)`,
|
||||
description: dashboard.description,
|
||||
elements: dashboard.elements || [],
|
||||
title: `${fullDashboard.title} (복사본)`,
|
||||
description: fullDashboard.description,
|
||||
elements: fullDashboard.elements || [],
|
||||
isPublic: false,
|
||||
tags: dashboard.tags,
|
||||
category: dashboard.category,
|
||||
tags: fullDashboard.tags,
|
||||
category: fullDashboard.category,
|
||||
settings: (fullDashboard as any).settings, // 해상도와 배경색 설정도 복사
|
||||
});
|
||||
alert("대시보드가 복사되었습니다.");
|
||||
loadDashboards();
|
||||
|
|
|
|||
Loading…
Reference in New Issue