From 008720ff4d388db50a5b51af7eb02c44616061d5 Mon Sep 17 00:00:00 2001 From: Milan Pavlik Date: Fri, 9 Sep 2022 08:53:01 +0000 Subject: [PATCH] [usage] Include drafts when listing usage summary --- components/usage/pkg/apiv1/usage.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/usage/pkg/apiv1/usage.go b/components/usage/pkg/apiv1/usage.go index 05052bf8e15b05..108f12e01b7870 100644 --- a/components/usage/pkg/apiv1/usage.go +++ b/components/usage/pkg/apiv1/usage.go @@ -78,8 +78,9 @@ func (s *UsageService) ListUsage(ctx context.Context, in *v1.ListUsageRequest) ( if in.GetPagination().GetPage() > 1 { page = in.GetPagination().GetPage() } - var offset int64 = perPage * (page - 1) + var offset = perPage * (page - 1) + excludeDrafts := false listUsageResult, err := db.FindUsage(ctx, s.conn, &db.FindUsageParams{ AttributionId: db.AttributionID(in.GetAttributionId()), From: from, @@ -87,6 +88,7 @@ func (s *UsageService) ListUsage(ctx context.Context, in *v1.ListUsageRequest) ( Order: order, Offset: offset, Limit: perPage, + ExcludeDrafts: excludeDrafts, }) logger := log.Log. WithField("attribution_id", in.AttributionId). @@ -124,7 +126,7 @@ func (s *UsageService) ListUsage(ctx context.Context, in *v1.ListUsageRequest) ( attributionId, from, to, - true, + excludeDrafts, ) if err != nil {