feat: implement single POST upsert API with automatic ID generation
- Replace separate POST/PUT endpoints with unified POST upsert - Add automatic content ID generation from element context when no ID provided - Implement version history preservation before content updates - Add element context support for backend ID generation - Update frontend to use single endpoint for all content operations - Enhanced demo site with latest database content including proper content IDs
This commit is contained in:
@@ -130,7 +130,7 @@ func runServe(cmd *cobra.Command, args []string) {
|
||||
contentRouter := apiRouter.PathPrefix("/content").Subrouter()
|
||||
contentRouter.HandleFunc("/bulk", contentHandler.GetBulkContent).Methods("GET")
|
||||
contentRouter.HandleFunc("/{id}", contentHandler.GetContent).Methods("GET")
|
||||
contentRouter.HandleFunc("/{id}", contentHandler.UpdateContent).Methods("PUT")
|
||||
|
||||
contentRouter.HandleFunc("", contentHandler.GetAllContent).Methods("GET")
|
||||
contentRouter.HandleFunc("", contentHandler.CreateContent).Methods("POST")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user