mirror of
https://github.com/grafana/grafana.git
synced 2025-01-27 00:37:04 -06:00
dashboards: fix updating folder so that correct url is returned
This commit is contained in:
parent
035b724725
commit
8fc648ac43
@ -257,6 +257,17 @@ export class BackendSrv {
|
||||
});
|
||||
}
|
||||
|
||||
updateDashboardFolder(dash, options) {
|
||||
options = options || {};
|
||||
|
||||
return this.post('/api/dashboards/db/', {
|
||||
dashboard: dash,
|
||||
isFolder: true,
|
||||
overwrite: options.overwrite === true,
|
||||
message: options.message || '',
|
||||
});
|
||||
}
|
||||
|
||||
deleteDashboard(uid) {
|
||||
let deferred = this.$q.defer();
|
||||
|
||||
|
@ -37,7 +37,7 @@ export class FolderSettingsCtrl {
|
||||
this.dashboard.title = this.title.trim();
|
||||
|
||||
return this.backendSrv
|
||||
.saveDashboard(this.dashboard, { overwrite: false })
|
||||
.updateDashboardFolder(this.dashboard, { overwrite: false })
|
||||
.then(result => {
|
||||
if (result.url !== this.$location.path()) {
|
||||
this.$location.url(result.url + '/settings');
|
||||
@ -84,7 +84,7 @@ export class FolderSettingsCtrl {
|
||||
yesText: 'Save & Overwrite',
|
||||
icon: 'fa-warning',
|
||||
onConfirm: () => {
|
||||
this.backendSrv.saveDashboard(this.dashboard, { overwrite: true });
|
||||
this.backendSrv.updateDashboardFolder(this.dashboard, { overwrite: true });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user