Fix critical collection persistence bug where initial items disappeared after first enhancement by implementing database-first pattern with template-based reconstruction

This commit is contained in:
2025-09-22 21:50:18 +02:00
parent 09823d3e4d
commit 5f494b8aa8
5 changed files with 312 additions and 27 deletions

View File

@@ -53,7 +53,9 @@ type ContentClient interface {
GetCollection(siteID, collectionID string) (*CollectionItem, error)
CreateCollection(siteID, collectionID, containerHTML, lastEditedBy string) (*CollectionItem, error)
GetCollectionItems(siteID, collectionID string) ([]CollectionItemWithTemplate, error)
GetCollectionTemplates(siteID, collectionID string) ([]CollectionTemplateItem, error)
CreateCollectionTemplate(siteID, collectionID, name, htmlTemplate string, isDefault bool) (*CollectionTemplateItem, error)
CreateCollectionItem(siteID, collectionID, itemID string, templateID int, htmlContent string, position int, lastEditedBy string) (*CollectionItemWithTemplate, error)
}
// ContentItem represents a piece of content from the database