Fix reaction JSON serialization - remove omitempty to ensure empty reactions are included as {} instead of null
This commit is contained in:
parent
0f0321aee1
commit
89901ab3f2
|
|
@ -47,11 +47,11 @@ type Post struct {
|
||||||
// Nested objects for JSON API
|
// Nested objects for JSON API
|
||||||
Author *AuthorProfile `json:"author,omitempty"`
|
Author *AuthorProfile `json:"author,omitempty"`
|
||||||
IsSponsored bool `json:"is_sponsored,omitempty"`
|
IsSponsored bool `json:"is_sponsored,omitempty"`
|
||||||
|
|
||||||
// Reaction data
|
// Reaction data
|
||||||
Reactions map[string]int `json:"reactions,omitempty"`
|
Reactions map[string]int `json:"reactions"`
|
||||||
MyReactions []string `json:"my_reactions,omitempty"`
|
MyReactions []string `json:"my_reactions"`
|
||||||
ReactionUsers map[string][]string `json:"reaction_users,omitempty"`
|
ReactionUsers map[string][]string `json:"reaction_users"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AuthorProfile struct {
|
type AuthorProfile struct {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue