Skip to content

Commit d618574

Browse files
authored
Merge pull request #1379 from openmeterio/notification-api
fix: missing payload in notification event
2 parents c002ba4 + 8f35441 commit d618574

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

internal/notification/event.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,13 @@ func (p EventPayload) AsNotificationEventBalanceThresholdPayload(eventId string,
205205
Subject api.Subject `json:"subject"`
206206
Threshold api.NotificationRuleBalanceThresholdValue `json:"threshold"`
207207
Value api.EntitlementValue `json:"value"`
208-
}{},
208+
}{
209+
Entitlement: p.BalanceThreshold.Entitlement,
210+
Feature: p.BalanceThreshold.Feature,
211+
Subject: p.BalanceThreshold.Subject,
212+
Threshold: p.BalanceThreshold.Threshold,
213+
Value: p.BalanceThreshold.Value,
214+
},
209215
Id: eventId,
210216
Timestamp: ts,
211217
Type: api.EntitlementsBalanceThreshold,
@@ -471,7 +477,7 @@ func PayloadToMapInterface(t any) (map[string]interface{}, error) {
471477
}
472478

473479
var m map[string]interface{}
474-
if err := json.Unmarshal(b, &m); err != nil {
480+
if err = json.Unmarshal(b, &m); err != nil {
475481
return nil, err
476482
}
477483

0 commit comments

Comments
 (0)