fix(sdlc): route conflict with SDLCGenerateHandler shadowing SDLC routes
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
SDLCGenerateHandler was using r.Route() to create a sub-router at
/projects/{id}/sdlc/features/{slug}, which shadowed SDLCHandler's
nested routes like /features/{slug}/artifacts/{type}/approve.
Changed to direct route registration to avoid chi route conflicts.
This fixes 404 errors on SDLC feature and artifact endpoints.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
4486042155
commit
00f55f7f6f
@ -24,10 +24,12 @@ func NewSDLCGenerateHandler(generateSvc *service.SDLCGenerateService) *SDLCGener
|
||||
}
|
||||
|
||||
// Mount registers the generate endpoint on the router.
|
||||
// Note: Uses direct route to avoid conflict with /projects/{id}/sdlc in sdlc.go.
|
||||
// Creating a Route() group at /projects/{id}/sdlc/features/{slug} shadows
|
||||
// the SDLCHandler's nested routes like /features/{slug}/artifacts/{type}/approve.
|
||||
func (h *SDLCGenerateHandler) Mount(r api.Router) {
|
||||
r.Route("/projects/{id}/sdlc/features/{slug}", func(r chi.Router) {
|
||||
r.With(auth.RequireScope(auth.ScopeProjectsExecute, auth.ScopeAdmin)).Post("/generate", h.Generate)
|
||||
})
|
||||
r.With(auth.RequireScope(auth.ScopeProjectsExecute, auth.ScopeAdmin)).
|
||||
Post("/projects/{id}/sdlc/features/{slug}/generate", h.Generate)
|
||||
}
|
||||
|
||||
// GenerateRequest is the request body for POST /projects/{id}/sdlc/features/{slug}/generate.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user