From 403438c53d604d643baef40c43725ece329a840b Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Fri, 18 Mar 2022 08:39:25 -0700 Subject: [PATCH] Fixing delete dashboard url form datasource configuration (#46637) (#46739) (cherry picked from commit c3ee98a9b67cc8a571361ba5567d2a7536fbecd8) Co-authored-by: lean.dev <34773040+leandro-deveikis@users.noreply.github.com> --- 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 9fdd7d1b5eb..a5f9838fefc 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() {