From 8f35441eb8c8ab2412fa0b96a1f88d6165fbf9d4 Mon Sep 17 00:00:00 2001 From: Krisztian Gacsal Date: Thu, 15 Aug 2024 17:38:54 +0200 Subject: [PATCH] fix: missing payload in notification event --- internal/notification/event.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/notification/event.go b/internal/notification/event.go index 1fd5499e1..0b544a8a6 100644 --- a/internal/notification/event.go +++ b/internal/notification/event.go @@ -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, @@ -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 }