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:
2026-10-09 16:24:20 +02:00
parent 57a347c97b
commit 740dcd086d
7 changed files with 317 additions and 2 deletions

View File

@@ -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,