diff options
author | 2022-12-15 09:41:49 +0100 | |
---|---|---|
committer | 2022-12-15 09:41:49 +0100 | |
commit | 1d24c1c28312a5a97746df2e091a0838fa24cb7e (patch) | |
tree | fc4641db7716520ea4f9db9a50e58f6b354deead /internal/typeutils/internaltofrontend.go | |
parent | [docs] Update Apache docs to use 127.0.0.1 instead of localhost (#1266) (diff) | |
download | gotosocial-1d24c1c28312a5a97746df2e091a0838fa24cb7e.tar.xz |
[bugfix] Use null for empty api status `language` (#1268)
* [bugfix] Use null for empty api status `language`
* update swagger docs
Diffstat (limited to 'internal/typeutils/internaltofrontend.go')
-rw-r--r-- | internal/typeutils/internaltofrontend.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/typeutils/internaltofrontend.go b/internal/typeutils/internaltofrontend.go index d6938ae83..ac182952e 100644 --- a/internal/typeutils/internaltofrontend.go +++ b/internal/typeutils/internaltofrontend.go @@ -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, |