Skip to content

Commit d1dcef5

Browse files
committed
fix: typo in webhook.EventTypes
1 parent 70c112d commit d1dcef5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

openmeter/notification/webhook/webhook.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func (i SendMessageInput) Validate() error {
241241
}
242242

243243
type RegisterEventTypesInputs struct {
244-
EvenTypes []EventType
244+
EventTypes []EventType
245245
AllowUpdate bool
246246
}
247247

@@ -271,7 +271,7 @@ const (
271271
type Config struct {
272272
SvixConfig
273273

274-
RegisterEvenTypes []EventType
274+
RegisterEventTypes []EventType
275275
RegistrationTimeout time.Duration
276276
SkipRegistrationOnError bool
277277

@@ -283,8 +283,8 @@ func New(config Config) (Handler, error) {
283283
return nil, errors.New("logger is required")
284284
}
285285

286-
if config.RegisterEvenTypes == nil {
287-
config.RegisterEvenTypes = NotificationEventTypes
286+
if config.RegisterEventTypes == nil {
287+
config.RegisterEventTypes = NotificationEventTypes
288288
}
289289

290290
if config.RegistrationTimeout == 0 {
@@ -296,12 +296,12 @@ func New(config Config) (Handler, error) {
296296
return nil, fmt.Errorf("failed to initialize Svix webhook handler: %w", err)
297297
}
298298

299-
if len(config.RegisterEvenTypes) > 0 {
299+
if len(config.RegisterEventTypes) > 0 {
300300
ctx, cancel := context.WithTimeout(context.Background(), config.RegistrationTimeout)
301301
defer cancel()
302302

303303
err = handler.RegisterEventTypes(ctx, RegisterEventTypesInputs{
304-
EvenTypes: config.RegisterEvenTypes,
304+
EventTypes: config.RegisterEventTypes,
305305
})
306306
if err != nil {
307307
if config.SkipRegistrationOnError {

test/notification/webhook.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type WebhookTestSuite struct {
4141

4242
func (s *WebhookTestSuite) Setup(ctx context.Context, t *testing.T) {
4343
err := s.Env.NotificationWebhook().RegisterEventTypes(ctx, notificationwebhook.RegisterEventTypesInputs{
44-
EvenTypes: notificationwebhook.NotificationEventTypes,
44+
EventTypes: notificationwebhook.NotificationEventTypes,
4545
})
4646
assert.NoError(t, err, "Registering event types must not fail")
4747
}

0 commit comments

Comments
 (0)