From f3ccfe5dcd14b8f3d1233fdd818e053cef028e48 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Thu, 5 Mar 2026 15:03:48 +0100 Subject: [PATCH] =?UTF-8?q?fix(ucca):=20Route-Konflikt=20:id=20vs=20:asses?= =?UTF-8?q?smentId=20=E2=80=94=20TOM-Controls=20Pfad=20geaendert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GET /obligations/:id/tom-controls → GET /obligations/tom-controls/for-obligation/:obligationId Gin erlaubt keine unterschiedlichen Param-Namen auf demselben Pfad-Level. Co-Authored-By: Claude Opus 4.6 --- .../components/sdk/obligations/TOMControlPanel.tsx | 2 +- .../internal/api/handlers/obligations_handlers.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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"})