Files
pgbackweb/internal/service/webhooks/update_webhook.sql
Luis Eduardo Jeréz Girón 0453aa946d Add edit webhook functionality
2024-09-01 21:41:45 -06:00

13 lines
512 B
SQL

-- name: WebhooksServiceUpdateWebhook :one
UPDATE webhooks
SET
name = COALESCE(sqlc.narg('name'), name),
is_active = COALESCE(sqlc.narg('is_active'), is_active),
event_type = COALESCE(sqlc.narg('event_type'), event_type),
target_ids = COALESCE(sqlc.narg('target_ids'), target_ids),
url = COALESCE(sqlc.narg('url'), url),
method = COALESCE(sqlc.narg('method'), method),
headers = COALESCE(sqlc.narg('headers'), headers),
body = COALESCE(sqlc.narg('body'), body)
WHERE id = @webhook_id
RETURNING *;