From 90ce48c598a6aeba1bb792ea366b7acbce469332 Mon Sep 17 00:00:00 2001 From: Gustav Westling Date: Fri, 18 Feb 2022 16:58:51 +0000 Subject: [PATCH] api/pkg/installation/statistics: remove validations for fields that default to 0 This fixes an issue where statistics with 0 codebases or users was considered invalid. --- sturdy --- user_id: 847dfd0c-49bf-40c5-8870-74a12fca0d60 view_id: 128badfe-5c58-487e-adfd-c4f1e4fd160f workspace_id: ac83b73f-5568-44bc-af8b-db64c50f006d --- api/pkg/installations/statistics/statistic.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/pkg/installations/statistics/statistic.go b/api/pkg/installations/statistics/statistic.go index 7fcc7475..61b7154f 100644 --- a/api/pkg/installations/statistics/statistic.go +++ b/api/pkg/installations/statistics/statistic.go @@ -11,7 +11,7 @@ type Statistic struct { IP *string `json:"-" db:"ip"` RecordedAt time.Time `json:"recorded_at" db:"recorded_at"` ReceivedAt time.Time `json:"-" db:"received_at"` - UsersCount uint64 `json:"users_count" db:"users_count" validate:"required"` - CodebasesCount uint64 `json:"codebases_count" db:"codebases_count" validate:"required"` + UsersCount uint64 `json:"users_count" db:"users_count"` + CodebasesCount uint64 `json:"codebases_count" db:"codebases_count"` FirstUserEmail *string `json:"first_user_email" db:"first_user_email"` }