Dashboards: Remove unique name constraints (#90687)
This commit is contained in:
@@ -1009,9 +1009,6 @@ func (s *Service) Move(ctx context.Context, cmd *folder.MoveFolderCommand) (*fol
|
||||
NewParentUID: &cmd.NewParentUID,
|
||||
SignedInUser: cmd.SignedInUser,
|
||||
}); err != nil {
|
||||
if s.db.GetDialect().IsUniqueConstraintViolation(err) {
|
||||
return folder.ErrConflict.Errorf("%w", dashboards.ErrFolderSameNameExists)
|
||||
}
|
||||
return folder.ErrInternal.Errorf("failed to move folder: %w", err)
|
||||
}
|
||||
|
||||
@@ -1023,9 +1020,6 @@ func (s *Service) Move(ctx context.Context, cmd *folder.MoveFolderCommand) (*fol
|
||||
// bypass optimistic locking used for dashboards
|
||||
Overwrite: true,
|
||||
}); err != nil {
|
||||
if s.db.GetDialect().IsUniqueConstraintViolation(err) {
|
||||
return folder.ErrConflict.Errorf("%w", dashboards.ErrFolderSameNameExists)
|
||||
}
|
||||
return folder.ErrInternal.Errorf("failed to move legacy folder: %w", err)
|
||||
}
|
||||
|
||||
@@ -1393,10 +1387,6 @@ func toFolderError(err error) error {
|
||||
return dashboards.ErrFolderAccessDenied
|
||||
}
|
||||
|
||||
if errors.Is(err, dashboards.ErrDashboardWithSameNameInFolderExists) {
|
||||
return dashboards.ErrFolderSameNameExists
|
||||
}
|
||||
|
||||
if errors.Is(err, dashboards.ErrDashboardWithSameUIDExists) {
|
||||
return dashboards.ErrFolderWithSameUIDExists
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user