chore: added weather to API response for posts 9936f3cd
Steve · 2026-06-07 14:34 1 file(s) · +4 −2
apps/posts/handlers_api.go +4 −2
22 22
	Content         string  `json:"content"`
23 23
	CreatedAt       string  `json:"created_at"`
24 24
	UpdatedAt       string  `json:"updated_at"`
25 +
	Weather         *string  `json:"weather"`
25 26
}
26 27
27 28
type apiPostDetail struct {
38 39
	Content         string  `json:"content"`
39 40
	CreatedAt       string  `json:"created_at"`
40 41
	UpdatedAt       string  `json:"updated_at"`
42 +
	Weather         *string  `json:"weather"`
41 43
}
42 44
43 45
func toSummary(p Post) apiPostSummary {
46 48
		PublishedDate: p.PublishedDate, MetaDescription: p.MetaDescription,
47 49
		MetaImage: p.MetaImage, CanonicalURL: p.CanonicalURL,
48 50
		Lang: p.Lang, Tags: p.Tags, Content: p.Content,
49 -
		CreatedAt: p.CreatedAt, UpdatedAt: p.UpdatedAt,
51 +
		CreatedAt: p.CreatedAt, UpdatedAt: p.UpdatedAt, Weather: p.Weather,
50 52
	}
51 53
}
52 54
56 58
		Alias: p.Alias, CanonicalURL: p.CanonicalURL,
57 59
		PublishedDate: p.PublishedDate, MetaDescription: p.MetaDescription,
58 60
		MetaImage: p.MetaImage, Lang: p.Lang, Tags: p.Tags,
59 -
		Content: p.Content, CreatedAt: p.CreatedAt, UpdatedAt: p.UpdatedAt,
61 +
		Content: p.Content, CreatedAt: p.CreatedAt, UpdatedAt: p.UpdatedAt, Weather: p.Weather,
60 62
	}
61 63
}
62 64