diff --git a/pkg/services/libraryelements/api.go b/pkg/services/libraryelements/api.go index 213722fd0b0..54bfdf9b423 100644 --- a/pkg/services/libraryelements/api.go +++ b/pkg/services/libraryelements/api.go @@ -81,6 +81,7 @@ func (l *LibraryElementService) createHandler(c *contextmodel.ReqContext) respon return toLibraryElementError(err, "Failed to create library element") } + // nolint:staticcheck if element.FolderID != 0 { folder, err := l.folderService.Get(c.Req.Context(), &folder.GetFolderQuery{OrgID: c.SignedInUser.GetOrgID(), ID: &element.FolderID, SignedInUser: c.SignedInUser}) if err != nil { @@ -223,6 +224,7 @@ func (l *LibraryElementService) patchHandler(c *contextmodel.ReqContext) respons return toLibraryElementError(err, "Failed to update library element") } + // nolint:staticcheck if element.FolderID != 0 { folder, err := l.folderService.Get(c.Req.Context(), &folder.GetFolderQuery{OrgID: c.SignedInUser.GetOrgID(), ID: &element.FolderID, SignedInUser: c.SignedInUser}) if err != nil { diff --git a/pkg/services/libraryelements/model/model.go b/pkg/services/libraryelements/model/model.go index 5d8804911e4..3b047c6f452 100644 --- a/pkg/services/libraryelements/model/model.go +++ b/pkg/services/libraryelements/model/model.go @@ -69,8 +69,9 @@ type LibraryElementWithMeta struct { // LibraryElementDTO is the frontend DTO for entities. type LibraryElementDTO struct { - ID int64 `json:"id"` - OrgID int64 `json:"orgId"` + ID int64 `json:"id"` + OrgID int64 `json:"orgId"` + // Deprecated: use FolderUID instead FolderID int64 `json:"folderId"` FolderUID string `json:"folderUid"` UID string `json:"uid"` diff --git a/pkg/services/librarypanels/librarypanels_test.go b/pkg/services/librarypanels/librarypanels_test.go index 8e61676c9f8..3914864451e 100644 --- a/pkg/services/librarypanels/librarypanels_test.go +++ b/pkg/services/librarypanels/librarypanels_test.go @@ -638,7 +638,7 @@ func toLibraryElement(t *testing.T, res model.LibraryElementDTO) libraryElement return libraryElement{ ID: res.ID, OrgID: res.OrgID, - FolderID: res.FolderID, + FolderID: res.FolderID, // nolint:staticcheck UID: res.UID, Name: res.Name, Type: res.Type, @@ -785,7 +785,7 @@ func scenarioWithLibraryPanel(t *testing.T, desc string, fn func(t *testing.T, s Result: libraryPanel{ ID: resp.ID, OrgID: resp.OrgID, - FolderID: resp.FolderID, + FolderID: resp.FolderID, // nolint:staticcheck UID: resp.UID, Name: resp.Name, Type: resp.Type, diff --git a/public/api-merged.json b/public/api-merged.json index c3dd7a61e0b..c66757a097b 100644 --- a/public/api-merged.json +++ b/public/api-merged.json @@ -15761,6 +15761,7 @@ "type": "string" }, "folderId": { + "description": "Deprecated: use FolderUID instead", "type": "integer", "format": "int64" }, diff --git a/public/openapi3.json b/public/openapi3.json index a379c2b1201..8348a396917 100644 --- a/public/openapi3.json +++ b/public/openapi3.json @@ -6673,6 +6673,7 @@ "type": "string" }, "folderId": { + "description": "Deprecated: use FolderUID instead", "format": "int64", "type": "integer" },