Skip to content

Commit 47fe02b

Browse files
committed
fix: add response error check in handleDuplicateChart
1 parent 6b260ad commit 47fe02b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

frontend/components/dashboard/chart-header.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ const ChartHeader = ({ chart, projectId }: ChartHeaderProps) => {
5555
config: settings.config,
5656
}),
5757
});
58+
if (!response.ok) {
59+
throw new Error(`Failed to duplicate chart: ${response.status}`);
60+
}
5861
const created = await response.json() as DashboardChart;
5962
return [...(currentData || []), created];
6063
},

0 commit comments

Comments
 (0)