Add isEnabled to webhook.

This commit is contained in:
Yang Luo
2021-12-26 21:02:56 +08:00
parent 0c665edcbc
commit 9943e3c316
13 changed files with 95 additions and 25 deletions

View File

@ -146,6 +146,10 @@ func GetRecordsByField(record *Record) []*Record {
func SendWebhooks(record *Record) error {
webhooks := getWebhooksByOrganization(record.Organization)
for _, webhook := range webhooks {
if !webhook.IsEnabled {
continue
}
matched := false
for _, event := range webhook.Events {
if record.Action == event {