diff --git a/admin-compliance/components/sdk/obligations/TOMControlPanel.tsx b/admin-compliance/components/sdk/obligations/TOMControlPanel.tsx index b4abdee..0882c1a 100644 --- a/admin-compliance/components/sdk/obligations/TOMControlPanel.tsx +++ b/admin-compliance/components/sdk/obligations/TOMControlPanel.tsx @@ -50,7 +50,7 @@ export default function TOMControlPanel({ obligationId, onClose }: TOMControlPan setLoading(true) setError(null) try { - const res = await fetch(`${UCCA_API}/${obligationId}/tom-controls`) + const res = await fetch(`${UCCA_API}/tom-controls/for-obligation/${obligationId}`) if (!res.ok) throw new Error(`HTTP ${res.status}`) const data = await res.json() setControls(data.controls || []) diff --git a/ai-compliance-sdk/internal/api/handlers/obligations_handlers.go b/ai-compliance-sdk/internal/api/handlers/obligations_handlers.go index 65b3ed6..568623c 100644 --- a/ai-compliance-sdk/internal/api/handlers/obligations_handlers.go +++ b/ai-compliance-sdk/internal/api/handlers/obligations_handlers.go @@ -99,7 +99,7 @@ func (h *ObligationsHandlers) RegisterRoutes(r *gin.RouterGroup) { obligations.POST("/assess-from-scope", h.AssessFromScope) // v2: TOM Control endpoints - obligations.GET("/:id/tom-controls", h.GetTOMControlsForObligation) + obligations.GET("/tom-controls/for-obligation/:obligationId", h.GetTOMControlsForObligation) obligations.POST("/gap-analysis", h.GapAnalysis) obligations.GET("/tom-controls/:controlId/obligations", h.GetObligationsForControl) } @@ -508,7 +508,7 @@ func (h *ObligationsHandlers) AssessFromScope(c *gin.Context) { // GetTOMControlsForObligation returns TOM controls linked to an obligation // GET /sdk/v1/ucca/obligations/:id/tom-controls func (h *ObligationsHandlers) GetTOMControlsForObligation(c *gin.Context) { - obligationID := c.Param("id") + obligationID := c.Param("obligationId") if h.tomMapper == nil { c.JSON(http.StatusNotImplemented, gin.H{"error": "TOM mapping not available"})