Webhook returns a single webhook by id. Requires super-admin auth. Logic migrated from internal/graphql/webhook.go.
(ctx context.Context, meta RequestMetadata, params *model.WebhookRequest)
| 222 | // Webhook returns a single webhook by id. Requires super-admin auth. Logic |
| 223 | // migrated from internal/graphql/webhook.go. |
| 224 | func (p *provider) Webhook(ctx context.Context, meta RequestMetadata, params *model.WebhookRequest) (*model.Webhook, *ResponseSideEffects, error) { |
| 225 | log := p.Log.With().Str("func", "Webhook").Logger() |
| 226 | if err := p.requireSuperAdmin(ctx, meta); err != nil { |
| 227 | return nil, nil, err |
| 228 | } |
| 229 | |
| 230 | webhook, err := p.StorageProvider.GetWebhookByID(ctx, params.ID) |
| 231 | if err != nil { |
| 232 | log.Debug().Err(err).Msg("failed GetWebhookByID") |
| 233 | return nil, nil, err |
| 234 | } |
| 235 | return webhook.AsAPIWebhook(), nil, nil |
| 236 | } |
| 237 | |
| 238 | // Webhooks returns a paginated list of webhooks. Requires super-admin auth. |
| 239 | // Logic migrated from internal/graphql/webhooks.go. |
nothing calls this directly
no test coverage detected