Skip to content

Commit

Permalink
Merge pull request #1379 from openmeterio/notification-api
Browse files Browse the repository at this point in the history
fix: missing payload in notification event
  • Loading branch information
chrisgacsal authored Aug 15, 2024
2 parents c002ba4 + 8f35441 commit d618574
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions internal/notification/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,13 @@ func (p EventPayload) AsNotificationEventBalanceThresholdPayload(eventId string,
Subject api.Subject `json:"subject"`
Threshold api.NotificationRuleBalanceThresholdValue `json:"threshold"`
Value api.EntitlementValue `json:"value"`
}{},
}{
Entitlement: p.BalanceThreshold.Entitlement,
Feature: p.BalanceThreshold.Feature,
Subject: p.BalanceThreshold.Subject,
Threshold: p.BalanceThreshold.Threshold,
Value: p.BalanceThreshold.Value,
},
Id: eventId,
Timestamp: ts,
Type: api.EntitlementsBalanceThreshold,
Expand Down Expand Up @@ -471,7 +477,7 @@ func PayloadToMapInterface(t any) (map[string]interface{}, error) {
}

var m map[string]interface{}
if err := json.Unmarshal(b, &m); err != nil {
if err = json.Unmarshal(b, &m); err != nil {
return nil, err
}

Expand Down

0 comments on commit d618574

Please sign in to comment.