(ctx context.Context, _ *struct{})
| 306 | } |
| 307 | |
| 308 | func (s *Server) handleListDomains(ctx context.Context, _ *struct{}) (*listDomainsOutput, error) { |
| 309 | user, err := s.requireAccountUser(ctx) |
| 310 | if err != nil { |
| 311 | return nil, err |
| 312 | } |
| 313 | domains, err := s.deps.ListDomains(ctx, user.ID) |
| 314 | if err != nil { |
| 315 | return nil, NewError(http.StatusInternalServerError, "internal_error", "failed to list domains") |
| 316 | } |
| 317 | items := make([]DomainView, 0, len(domains)) |
| 318 | for i := range domains { |
| 319 | items = append(items, s.domainView(&domains[i])) |
| 320 | } |
| 321 | return &listDomainsOutput{Body: NewPage(items, "")}, nil |
| 322 | } |
| 323 | |
| 324 | func (s *Server) handleGetDomain(ctx context.Context, in *DomainParam) (*domainOutput, error) { |
| 325 | user, err := s.requireAccountUser(ctx) |
nothing calls this directly
no test coverage detected