From 61ece180548b7c8c234e5b842a2c04a48a117c97 Mon Sep 17 00:00:00 2001 From: Dragan Obradovic Date: Wed, 13 Mar 2024 15:55:02 +0100 Subject: [PATCH] Allowing only alert trigger type to have empty configuration --- model/actions/trigger.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/model/actions/trigger.go b/model/actions/trigger.go index f3ac29d..4021176 100644 --- a/model/actions/trigger.go +++ b/model/actions/trigger.go @@ -30,11 +30,6 @@ func (a Trigger) Validate(ctx ValidatorContext) (response ValidateResponse) { return response.Error(ctx, MsgTriggerTypeNotSupported, a.Type, TriggerTypes) } - // This handles just type - if a.Periodic == nil && a.Webhook == nil && a.Block == nil && a.Transaction == nil && a.Alert == nil { - return response - } - switch a.Type { case PeriodicType: if a.Periodic == nil { @@ -58,7 +53,7 @@ func (a Trigger) Validate(ctx ValidatorContext) (response ValidateResponse) { return response.Merge(a.Transaction.Validate(ctx.With(a.Type))) case AlertType: if a.Alert == nil { - return response.Error(ctx, MsgTriggerTypeMismatch, a.Type) + return response } return response.Merge(a.Alert.Validate(ctx.With(a.Type))) }