Skip to main content

update

Function update 

Source
pub async fn update(
    pool: &PgPool,
    actor: &Actor,
    policy: &TargetPolicy,
    id: Uuid,
    input: WebhookInput,
) -> AppResult<Webhook>
Expand description

Changes name, URL, events, project group and the active flag. Pending deliveries of a webhook that is switched off are given up.

§Invariants

  • Permission: administrator (403); unknown webhook is “not found”; input is validated as in create (400).
  • Locks: the webhook row (FOR UPDATE).
  • Data: switching an active webhook off marks its pending deliveries as failed.
  • Audit: webhook.update (host of the URL, never the full URL).
  • Notifications / webhooks: none.
  • Atomic: one transaction.