(ctx context.Context, _ *struct{})
| 512 | } |
| 513 | |
| 514 | func (s *Server) handleListWebhooks(ctx context.Context, _ *struct{}) (*listWebhooksOutput, error) { |
| 515 | user, err := s.requireAccountUser(ctx) |
| 516 | if err != nil { |
| 517 | return nil, err |
| 518 | } |
| 519 | hooks, err := s.deps.ListWebhooks(ctx, user.ID) |
| 520 | if err != nil { |
| 521 | return nil, NewError(http.StatusInternalServerError, "internal_error", "failed to list webhooks") |
| 522 | } |
| 523 | items := make([]WebhookView, 0, len(hooks)) |
| 524 | for i := range hooks { |
| 525 | items = append(items, webhookView(&hooks[i])) |
| 526 | } |
| 527 | return &listWebhooksOutput{Body: NewPage(items, "")}, nil |
| 528 | } |
| 529 | |
| 530 | func (s *Server) handleGetWebhook(ctx context.Context, in *WebhookIDParam) (*webhookOutput, error) { |
| 531 | user, err := s.requireAccountUser(ctx) |
nothing calls this directly
no test coverage detected