From 650956f0e9c86ce7e2e4c550008107061344d2cc Mon Sep 17 00:00:00 2001 From: Cronus <105345303+ice-cronus@users.noreply.github.com> Date: Sat, 22 Jun 2024 23:31:16 +0700 Subject: [PATCH] use total users as active in days also (#157) --- cmd/eskimo-hut/eskimo.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/eskimo-hut/eskimo.go b/cmd/eskimo-hut/eskimo.go index 75311fa7..3d54dfbf 100644 --- a/cmd/eskimo-hut/eskimo.go +++ b/cmd/eskimo-hut/eskimo.go @@ -224,7 +224,7 @@ func (s *service) GetTopCountries( //nolint:gocritic // False negative. // @Failure 500 {object} server.ErrorResponse // @Failure 504 {object} server.ErrorResponse "if request times out" // @Router /v1r/user-statistics/user-growth [GET]. -func (s *service) GetUserGrowth( //nolint:gocritic // False negative. +func (s *service) GetUserGrowth( //nolint:funlen,gocritic // False negative. ctx context.Context, req *server.Request[GetUserGrowthArg, users.UserGrowthStatistics], ) (*server.Response[users.UserGrowthStatistics], *server.Response[server.ErrorResponse]) { @@ -251,7 +251,12 @@ func (s *service) GetUserGrowth( //nolint:gocritic // False negative. if err != nil { return nil, server.Unexpected(errors.Wrapf(err, "failed to get user growth stats for: %#v", req.Data)) } - result.Total = result.Active + if true { + result.Total = result.Active + for i := range result.TimeSeries { + result.TimeSeries[i].Total = result.TimeSeries[i].Active + } + } return server.OK(result), nil }