fix disable webhook on update

Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
Ronni Skansing
2025-12-17 19:09:10 +01:00
parent 8bf457c592
commit e11156899c

View File

@@ -1391,8 +1391,13 @@ func (c *Campaign) UpdateByID(
if v, err := incoming.RecipientGroupIDs.Get(); err == nil {
current.RecipientGroupIDs.Set(v)
}
if v, err := incoming.WebhookID.Get(); err == nil {
current.WebhookID.Set(v)
// handle webhook ID
if incoming.WebhookID.IsSpecified() {
if incoming.WebhookID.IsNull() {
current.WebhookID.SetNull()
} else {
current.WebhookID.Set(incoming.WebhookID.MustGet())
}
}
// check there is atleast one valid group