Consolidate type definitions and fix API contract
- Move all ContentItem, ContentClient, ContentResponse types to engine/types.go as single source of truth - Remove duplicate type definitions from content/types.go - Update all imports across codebase to use engine types - Enhance engine to extract existing data-content-id from HTML markup - Simplify frontend to always send html_markup, let server handle ID extraction/generation - Fix contentId reference errors in frontend error handling - Add getAttribute helper method to engine for ID extraction - Add GetAllContent method to engine.DatabaseClient - Update enhancer to use engine.ContentClient interface - All builds and API endpoints verified working This resolves the 400 Bad Request errors and creates a unified architecture where the server is the single source of truth for all ID generation and content type management.
This commit is contained in:
@@ -15,7 +15,7 @@ type Enhancer struct {
|
||||
}
|
||||
|
||||
// NewEnhancer creates a new HTML enhancer using unified engine
|
||||
func NewEnhancer(client ContentClient, siteID string) *Enhancer {
|
||||
func NewEnhancer(client engine.ContentClient, siteID string) *Enhancer {
|
||||
// Create database client for engine
|
||||
var engineClient engine.ContentClient
|
||||
if dbClient, ok := client.(*DatabaseClient); ok {
|
||||
|
||||
Reference in New Issue
Block a user