mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 02:42:22 +08:00
Chore: Deprecate FolderID in PatchLibraryElementCommand (#77472)
* Chore: Deprecate FolderID in PatchLibraryElementCommand * chore: regen specs
This commit is contained in:
@ -45,6 +45,7 @@ func TestLibraryElementPermissionsGeneralFolder(t *testing.T) {
|
||||
result := validateAndUnMarshalResponse(t, resp)
|
||||
sc.reqContext.SignedInUser.OrgRole = testCase.role
|
||||
|
||||
// nolint:staticcheck
|
||||
cmd := model.PatchLibraryElementCommand{FolderID: 0, Version: 1, Kind: int64(model.PanelElement)}
|
||||
sc.ctx.Req = web.SetURLParams(sc.ctx.Req, map[string]string{":uid": result.Result.UID})
|
||||
sc.ctx.Req.Body = mockRequestBody(cmd)
|
||||
@ -61,6 +62,7 @@ func TestLibraryElementPermissionsGeneralFolder(t *testing.T) {
|
||||
result := validateAndUnMarshalResponse(t, resp)
|
||||
sc.reqContext.SignedInUser.OrgRole = testCase.role
|
||||
|
||||
// nolint:staticcheck
|
||||
cmd := model.PatchLibraryElementCommand{FolderID: folder.ID, Version: 1, Kind: int64(model.PanelElement)}
|
||||
sc.ctx.Req = web.SetURLParams(sc.ctx.Req, map[string]string{":uid": result.Result.UID})
|
||||
sc.ctx.Req.Body = mockRequestBody(cmd)
|
||||
@ -242,6 +244,7 @@ func TestLibraryElementPatchPermissions(t *testing.T) {
|
||||
1: testCase.permissions,
|
||||
}
|
||||
|
||||
// nolint:staticcheck
|
||||
cmd := model.PatchLibraryElementCommand{FolderID: toFolder.ID, Version: 1, Kind: int64(model.PanelElement)}
|
||||
sc.ctx.Req = web.SetURLParams(sc.ctx.Req, map[string]string{":uid": result.Result.UID})
|
||||
sc.reqContext.Req.Body = mockRequestBody(cmd)
|
||||
@ -324,6 +327,7 @@ func TestLibraryElementsWithMissingFolders(t *testing.T) {
|
||||
resp := sc.service.createHandler(sc.reqContext)
|
||||
result := validateAndUnMarshalResponse(t, resp)
|
||||
|
||||
// nolint:staticcheck
|
||||
cmd := model.PatchLibraryElementCommand{FolderID: -100, Version: 1, Kind: int64(model.PanelElement)}
|
||||
sc.ctx.Req = web.SetURLParams(sc.ctx.Req, map[string]string{":uid": result.Result.UID})
|
||||
sc.reqContext.Req.Body = mockRequestBody(cmd)
|
||||
|
Reference in New Issue
Block a user