Dashboard: Fix for overwriting an edited dashboard in the old architecture (#100288)
Dashboard: Fix for overwriting an edited dashboard in the old architecture (#100247)
(cherry picked from commit 158c5443b5)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
import { useAsyncFn } from 'react-use';
|
||||
|
||||
import { locationUtil } from '@grafana/data';
|
||||
@@ -45,6 +46,8 @@ export const useDashboardSave = (isCopy = false) => {
|
||||
const result = await saveDashboard(clone, options, dashboard, saveDashboardRtkQuery);
|
||||
dashboard.version = result.version;
|
||||
|
||||
// Altering the clone leads to an error due to the clone being immutable
|
||||
clone = cloneDeep(clone);
|
||||
clone.version = result.version;
|
||||
dashboard.clearUnsavedChanges(clone, options);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user