mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
LibraryPanels: Prevents changing the folder when saving an existing library panel (#38978)
This commit is contained in:
parent
a960aae4e7
commit
bfb34b9c1a
@ -66,15 +66,11 @@ export async function addLibraryPanel(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateLibraryPanel(
|
export async function updateLibraryPanel(panelSaveModel: PanelModelWithLibraryPanel): Promise<LibraryElementDTO> {
|
||||||
panelSaveModel: PanelModelWithLibraryPanel,
|
|
||||||
folderId: number
|
|
||||||
): Promise<LibraryElementDTO> {
|
|
||||||
const { uid, name, version } = panelSaveModel.libraryPanel;
|
const { uid, name, version } = panelSaveModel.libraryPanel;
|
||||||
const kind = LibraryElementKind.Panel;
|
const kind = LibraryElementKind.Panel;
|
||||||
const model = panelSaveModel;
|
const model = panelSaveModel;
|
||||||
const { result } = await getBackendSrv().patch(`/api/library-elements/${uid}`, {
|
const { result } = await getBackendSrv().patch(`/api/library-elements/${uid}`, {
|
||||||
folderId,
|
|
||||||
name,
|
name,
|
||||||
model,
|
model,
|
||||||
version,
|
version,
|
||||||
|
@ -56,5 +56,5 @@ function saveOrUpdateLibraryPanel(panel: any, folderId: number): Promise<Library
|
|||||||
return addLibraryPanel(panel, folderId!);
|
return addLibraryPanel(panel, folderId!);
|
||||||
}
|
}
|
||||||
|
|
||||||
return updateLibraryPanel(panel, folderId!);
|
return updateLibraryPanel(panel);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user