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.
This commit is contained in:
Roberto Dip 2023-01-23 12:17:38 -03:00 committed by GitHub
parent 76417c3966
commit c2f3d6916c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"`