package tag import ( "context" "git.aiterp.net/rpdata2-take2/rpdata2" "git.aiterp.net/rpdata2-take2/rpdata2/auth" ) type Service struct { Repository Repository Auth auth.Service } func (s *Service) Find(ctx context.Context, id string) (*Node, error) { tags, err := s.Repository.FindRecursive(ctx, id) if err != nil { return nil, err } root := BuildForest(tags)[0].WithoutSecret(s.Auth.GetUser(ctx)) if root == nil { return nil, rpdata2.NotFound("Tag") } return root, nil }