1
0

feat(webhooks): add setting to enable webhooks

This commit is contained in:
kolaente
2023-10-17 19:03:11 +02:00
parent 8cc775ac4c
commit 34a92b759e
3 changed files with 21 additions and 9 deletions

View File

@ -18,6 +18,7 @@ package models
import (
"bytes"
"code.vikunja.io/api/pkg/config"
"code.vikunja.io/api/pkg/events"
"code.vikunja.io/api/pkg/log"
"code.vikunja.io/api/pkg/user"
@ -67,6 +68,10 @@ func init() {
}
func RegisterEventForWebhook(event events.Event) {
if !config.WebhooksEnabled.GetBool() {
return
}
availableWebhookEventsLock.Lock()
defer availableWebhookEventsLock.Unlock()