Implement complete API routes and mock authentication for full CMS functionality
- Add comprehensive nested route structure with proper authentication layers - Implement UpdateContent and ReorderCollectionItems handlers with repository pattern - Add automatic mock JWT token fetching for seamless development workflow - Restore content editing and collection reordering functionality broken after database refactoring - Provide production-ready authentication architecture with development convenience - Enable full CMS operations in browser with proper CRUD and bulk transaction support
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package api
|
||||
|
||||
import "github.com/insertr/insertr/internal/db"
|
||||
|
||||
// Use db package types directly for API responses - no duplication needed
|
||||
// Request models are kept below as they're different (input DTOs)
|
||||
|
||||
@@ -59,12 +61,7 @@ type UpdateCollectionItemRequest struct {
|
||||
UpdatedBy string `json:"updated_by,omitempty"`
|
||||
}
|
||||
|
||||
type CollectionItemPosition struct {
|
||||
ItemID string `json:"itemId"`
|
||||
Position int `json:"position"`
|
||||
}
|
||||
|
||||
type ReorderCollectionRequest struct {
|
||||
Items []CollectionItemPosition `json:"items"`
|
||||
UpdatedBy string `json:"updated_by,omitempty"`
|
||||
Items []db.CollectionItemPosition `json:"items"`
|
||||
UpdatedBy string `json:"updated_by,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user