feat(api): serve the category content field on GET /_journal/api/v1/categories
- add the nullable TEXT column golem15_journal_categories.content (migration 202610090001) - map it as models.Category.Content and emit category content on every categories row - document the categories row shape and the stored-as-is HTML semantics
This commit is contained in:
@@ -195,6 +195,10 @@ func serializeCategoryNode(c *models.Category, byParent map[uint][]models.Catego
|
||||
if c.Description != nil {
|
||||
desc = *c.Description
|
||||
}
|
||||
var content any
|
||||
if c.Content != nil {
|
||||
content = *c.Content
|
||||
}
|
||||
var parent any
|
||||
if c.ParentID != nil {
|
||||
parent = *c.ParentID
|
||||
@@ -208,6 +212,7 @@ func serializeCategoryNode(c *models.Category, byParent map[uint][]models.Catego
|
||||
"name": c.Name,
|
||||
"slug": c.Slug,
|
||||
"description": desc,
|
||||
"content": content,
|
||||
"parent_id": parent,
|
||||
"nest_depth": depth,
|
||||
"post_count": postCount,
|
||||
|
||||
Reference in New Issue
Block a user