[bugfix] Use null for empty api status language (#1268)

* [bugfix] Use null for empty api status `language`

* update swagger docs
This commit is contained in:
tobi
2022-12-15 09:41:49 +01:00
committed by GitHub
parent bae73982f7
commit 1d24c1c283
5 changed files with 31 additions and 5 deletions

View File

@ -508,6 +508,11 @@ func (c *converter) StatusToAPIStatus(ctx context.Context, s *gtsmodel.Status, r
interacts = &statusInteractions{}
}
var language *string
if s.Language != "" {
language = &s.Language
}
apiStatus := &model.Status{
ID: s.ID,
CreatedAt: util.FormatISO8601(s.CreatedAt),
@ -516,7 +521,7 @@ func (c *converter) StatusToAPIStatus(ctx context.Context, s *gtsmodel.Status, r
Sensitive: *s.Sensitive,
SpoilerText: s.ContentWarning,
Visibility: c.VisToAPIVis(ctx, s.Visibility),
Language: s.Language,
Language: language,
URI: s.URI,
URL: s.URL,
RepliesCount: repliesCount,