mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 20:59:35 +08:00
Browse dashboards: Use dashboard DashboardAPI (#97387)
* Browse dashboards: Use dashboard DashboardAPI * Browse dashboards: Use DashboardAPI for deleting * Browse dashboards: Use DashboardAPI for uid validation
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { t } from 'i18next';
|
||||
|
||||
import { getBackendSrv } from '@grafana/runtime';
|
||||
import { getDashboardAPI } from 'app/features/dashboard/api/dashboard_api';
|
||||
|
||||
import { validationSrv } from '../services/ValidationSrv';
|
||||
|
||||
@ -47,8 +47,8 @@ export const validateTitle = (newTitle: string, folderUid: string) => {
|
||||
};
|
||||
|
||||
export const validateUid = (value: string) => {
|
||||
return getBackendSrv()
|
||||
.get(`/api/dashboards/uid/${value}`)
|
||||
return getDashboardAPI()
|
||||
.getDashboardDTO(value)
|
||||
.then((existingDashboard) => {
|
||||
return `Dashboard named '${existingDashboard?.dashboard.title}' in folder '${existingDashboard?.meta.folderTitle}' has the same UID`;
|
||||
})
|
||||
|
Reference in New Issue
Block a user