From c3ee98a9b67cc8a571361ba5567d2a7536fbecd8 Mon Sep 17 00:00:00 2001 From: "lean.dev" <34773040+leandro-deveikis@users.noreply.github.com> Date: Fri, 18 Mar 2022 11:47:57 -0300 Subject: [PATCH] Fixing delete dashboard url form datasource configuration (#46637) --- public/app/features/dashboard/state/actions.ts | 4 ++-- public/app/features/datasources/DataSourceDashboards.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/app/features/dashboard/state/actions.ts b/public/app/features/dashboard/state/actions.ts index 9ae183fc475..e6c070c2c1b 100644 --- a/public/app/features/dashboard/state/actions.ts +++ b/public/app/features/dashboard/state/actions.ts @@ -106,9 +106,9 @@ export function importDashboard(data: any, dashboardTitle: string): ThunkResult< }; } -export function removeDashboard(uri: string): ThunkResult { +export function removeDashboard(uid: string): ThunkResult { return async (dispatch) => { - await getBackendSrv().delete(`/api/dashboards/${uri}`); + await getBackendSrv().delete(`/api/dashboards/uid/${uid}`); dispatch(loadPluginDashboards()); }; } diff --git a/public/app/features/datasources/DataSourceDashboards.tsx b/public/app/features/datasources/DataSourceDashboards.tsx index 425402ba3b2..f035776ddae 100644 --- a/public/app/features/datasources/DataSourceDashboards.tsx +++ b/public/app/features/datasources/DataSourceDashboards.tsx @@ -71,7 +71,7 @@ export class DataSourceDashboards extends PureComponent { }; onRemove = (dashboard: PluginDashboard) => { - this.props.removeDashboard(dashboard.importedUri); + this.props.removeDashboard(dashboard.uid); }; render() {