diff --git a/frontend/src/container/ListOfDashboard/DashboardsList.tsx b/frontend/src/container/ListOfDashboard/DashboardsList.tsx index d45ddaebdda..afaa597139f 100644 --- a/frontend/src/container/ListOfDashboard/DashboardsList.tsx +++ b/frontend/src/container/ListOfDashboard/DashboardsList.tsx @@ -27,7 +27,6 @@ import { AxiosError } from 'axios'; import cx from 'classnames'; import { ENTITY_VERSION_V4 } from 'constants/app'; import ROUTES from 'constants/routes'; -import { sanitizeDashboardData } from 'container/NewDashboard/DashboardDescription'; import { downloadObjectAsJson } from 'container/NewDashboard/DashboardDescription/utils'; import { Base64Icons } from 'container/NewDashboard/DashboardSettings/General/utils'; import dayjs from 'dayjs'; @@ -456,18 +455,7 @@ function DashboardsList(): JSX.Element { const handleJsonExport = (event: React.MouseEvent): void => { event.stopPropagation(); event.preventDefault(); - const selectedDashboardData = dashboards?.find( - (d) => d.uuid === dashboard.id, - ); - if (selectedDashboardData) { - downloadObjectAsJson( - sanitizeDashboardData({ - ...selectedDashboardData.data, - uuid: selectedDashboardData.uuid, - }), - dashboard.name, - ); - } + downloadObjectAsJson(dashboard, dashboard.name); }; return ( diff --git a/frontend/src/container/NewDashboard/DashboardDescription/index.tsx b/frontend/src/container/NewDashboard/DashboardDescription/index.tsx index 7845cf818ea..151fba7609b 100644 --- a/frontend/src/container/NewDashboard/DashboardDescription/index.tsx +++ b/frontend/src/container/NewDashboard/DashboardDescription/index.tsx @@ -65,7 +65,7 @@ interface DashboardDescriptionProps { handle: FullScreenHandle; } -export function sanitizeDashboardData( +function sanitizeDashboardData( selectedData: DashboardData, ): Omit { if (!selectedData?.variables) {