Skip to content

Commit 2118ed4

Browse files
authored
Allowing only alert trigger type to have empty configuration (#180)
1 parent fe1cb3d commit 2118ed4

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

model/actions/trigger.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ func (a Trigger) Validate(ctx ValidatorContext) (response ValidateResponse) {
3030
return response.Error(ctx, MsgTriggerTypeNotSupported, a.Type, TriggerTypes)
3131
}
3232

33-
// This handles just type
34-
if a.Periodic == nil && a.Webhook == nil && a.Block == nil && a.Transaction == nil && a.Alert == nil {
35-
return response
36-
}
37-
3833
switch a.Type {
3934
case PeriodicType:
4035
if a.Periodic == nil {
@@ -58,7 +53,7 @@ func (a Trigger) Validate(ctx ValidatorContext) (response ValidateResponse) {
5853
return response.Merge(a.Transaction.Validate(ctx.With(a.Type)))
5954
case AlertType:
6055
if a.Alert == nil {
61-
return response.Error(ctx, MsgTriggerTypeMismatch, a.Type)
56+
return response
6257
}
6358
return response.Merge(a.Alert.Validate(ctx.With(a.Type)))
6459
}

0 commit comments

Comments
 (0)