From c2f3d6916cbaf435d4c516c0479ecb9fbcccdd91 Mon Sep 17 00:00:00 2001 From: Roberto Dip Date: Mon, 23 Jan 2023 12:17:38 -0300 Subject: [PATCH] omit actor information from activities if not present (#9428) This is a follow up from #9127 in order to completely omit those fields from the response instead of returning `null` in order to be consistent with how the API generally works. --- server/fleet/activities.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/fleet/activities.go b/server/fleet/activities.go index ab87ba124c..9526773399 100644 --- a/server/fleet/activities.go +++ b/server/fleet/activities.go @@ -433,10 +433,10 @@ func (a ActivityTypeUserAddedBySSO) Documentation() (activity string, details st type Activity struct { CreateTimestamp ID uint `json:"id" db:"id"` - ActorFullName *string `json:"actor_full_name" db:"name"` - ActorID *uint `json:"actor_id" db:"user_id"` - ActorGravatar *string `json:"actor_gravatar" db:"gravatar_url"` - ActorEmail *string `json:"actor_email" db:"email"` + ActorFullName *string `json:"actor_full_name,omitempty" db:"name"` + ActorID *uint `json:"actor_id,omitempty" db:"user_id"` + ActorGravatar *string `json:"actor_gravatar,omitempty" db:"gravatar_url"` + ActorEmail *string `json:"actor_email,omitempty" db:"email"` Type string `json:"type" db:"activity_type"` Details *json.RawMessage `json:"details" db:"details"` Streamed *bool `json:"-" db:"streamed"`