Skip to content

Commit

Permalink
Add missing items (#2099)
Browse files Browse the repository at this point in the history
  • Loading branch information
GAlexIHU authored Jan 17, 2025
1 parent 0e68bfa commit d2730b6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions openmeter/subscription/subscriptionview.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ func (v SubscriptionView) WithoutItemHistory() SubscriptionView {
for i, phase := range v.Phases {
phase2 := phase
phase2.ItemsByKey = make(map[string][]SubscriptionItemView)
for key, items := range phase.ItemsByKey {
if len(items) > 0 {
// only keep the last item
phase2.ItemsByKey[key] = items[len(items)-1:]
}
}
v2.Phases[i] = phase2
}
return v2
Expand Down

0 comments on commit d2730b6

Please sign in to comment.