mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Nested Folders: Set user in the API level (#59148)
This commit is contained in:
committed by
GitHub
parent
4a628f18b0
commit
02b6b09121
@@ -86,15 +86,20 @@ func (s *ImportDashboardService) ImportDashboard(ctx context.Context, req *dashb
|
||||
// here we need to get FolderId from FolderUID if it present in the request, if both exist, FolderUID would overwrite FolderID
|
||||
if req.FolderUid != "" {
|
||||
folder, err := s.folderService.Get(ctx, &folder.GetFolderQuery{
|
||||
OrgID: req.User.OrgID,
|
||||
UID: &req.FolderUid,
|
||||
OrgID: req.User.OrgID,
|
||||
UID: &req.FolderUid,
|
||||
SignedInUser: req.User,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req.FolderId = folder.ID
|
||||
} else {
|
||||
folder, err := s.folderService.Get(ctx, &folder.GetFolderQuery{ID: &req.FolderId, OrgID: req.User.OrgID})
|
||||
folder, err := s.folderService.Get(ctx, &folder.GetFolderQuery{
|
||||
ID: &req.FolderId,
|
||||
OrgID: req.User.OrgID,
|
||||
SignedInUser: req.User,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user