Chore: Fix error handling in postDashboard, remove UserDisplayDTO, fix live redis client initialization (#87206)
* clean up error handling in postDashboard and remove UserDisplayDTO * replace GetUserUID with GetUID and GetNamespacedUID, enforce namespace constant type * lint fix * lint fix * more lint fixes
This commit is contained in:
@@ -109,12 +109,11 @@ func (s *ImportDashboardService) ImportDashboard(ctx context.Context, req *dashb
|
||||
req.FolderUid = folder.UID
|
||||
}
|
||||
|
||||
namespaceID, identifier := req.User.GetNamespacedID()
|
||||
namespace, identifier := req.User.GetNamespacedID()
|
||||
userID := int64(0)
|
||||
|
||||
switch namespaceID {
|
||||
case identity.NamespaceUser, identity.NamespaceServiceAccount:
|
||||
userID, _ = identity.IntIdentifier(namespaceID, identifier)
|
||||
if namespace == identity.NamespaceUser || namespace == identity.NamespaceServiceAccount {
|
||||
userID, _ = identity.IntIdentifier(namespace, identifier)
|
||||
}
|
||||
|
||||
saveCmd := dashboards.SaveDashboardCommand{
|
||||
|
||||
Reference in New Issue
Block a user