Dashboards: Fix creating dashboard under folder using deprecated API (#77501)

* Dashboards: Add integration tests for creating a dashboard

* Fix creating dashboard under folder using deprecated API

* Update swagger response

* Fix comments
This commit is contained in:
Sofia Papagiannaki
2023-11-01 17:01:54 +02:00
committed by GitHub
parent 8b43d1b1ab
commit dfc33a70b7
6 changed files with 185 additions and 9 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ func (s *Service) Get(ctx context.Context, cmd *folder.GetFolderQuery) (*folder.
var dashFolder *folder.Folder
var err error
switch {
case cmd.UID != nil:
case cmd.UID != nil && *cmd.UID != "":
dashFolder, err = s.getFolderByUID(ctx, cmd.OrgID, *cmd.UID)
if err != nil {
return nil, err
+2 -2
View File
@@ -13,9 +13,9 @@ type Service interface {
Create(ctx context.Context, cmd *CreateFolderCommand) (*Folder, error)
// GetFolder takes a GetFolderCommand and returns a folder matching the
// request. One of ID, UID, or Title must be included. If multiple values
// request. One of UID, ID or Title must be included. If multiple values
// are included in the request, Grafana will select one in order of
// specificity (ID, UID, Title).
// specificity (UID, ID, Title).
Get(ctx context.Context, cmd *GetFolderQuery) (*Folder, error)
// Update is used to update a folder's UID, Title and Description. To change