This commit is contained in:
@@ -34,7 +34,7 @@ type PostDTO struct {
|
||||
Language string `json:"language"` // UI locale from ?lang= (matches text selection)
|
||||
SourceLanguage string `json:"sourceLanguage,omitempty"` // DB source metadata (admin input language)
|
||||
Text string `json:"text,omitempty"`
|
||||
Localizations map[string]postLocalePayload `json:"localizations"`
|
||||
Localizations map[string]postLocalePayload `json:"localizations,omitempty"`
|
||||
Attachments []AttachmentDTO `json:"attachments"`
|
||||
IsRecommended bool `json:"isRecommended"`
|
||||
PublishedAt string `json:"publishedAt"`
|
||||
@@ -439,10 +439,10 @@ func scanPostRow(r *http.Request, row pgx.Row) (PostDTO, postTextI18n, error) {
|
||||
if slug != nil {
|
||||
dto.CategorySlug = *slug
|
||||
}
|
||||
dto.SourceLanguage = sourceLang
|
||||
dto.Language = requestLangCode(r)
|
||||
dto.Text = texts.pick(r)
|
||||
dto.Localizations = texts.toLocalizations()
|
||||
src := normalizePostSourceLang(sourceLang)
|
||||
dto.SourceLanguage = src
|
||||
dto.Language = src
|
||||
dto.Text = texts.textForLang(src)
|
||||
if pub != nil {
|
||||
dto.PublishedAt = pub.UTC().Format(time.RFC3339)
|
||||
} else if created != nil {
|
||||
|
||||
Reference in New Issue
Block a user