fix(api): remove 307 redirect on GET /api/workflows

Change list/create route paths from '/' to '' on workflow_router so
GET /api/workflows and POST /api/workflows respond directly without
307 redirect. The redirect was causing axios to drop the Authorization
header, making the WorkflowEditor always show an empty list.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 18:26:27 +01:00
parent df02067687
commit 979b0082ec
@@ -29,7 +29,7 @@ from app.domains.rendering.schemas import (
router = APIRouter(prefix="/api/workflows", tags=["workflows"])
@router.get("/", response_model=list[WorkflowDefinitionOut])
@router.get("", response_model=list[WorkflowDefinitionOut])
async def list_workflows(
_user: User = Depends(require_admin_or_pm),
db: AsyncSession = Depends(get_db),
@@ -55,7 +55,7 @@ async def get_workflow(
return wf
@router.post("/", response_model=WorkflowDefinitionOut, status_code=201)
@router.post("", response_model=WorkflowDefinitionOut, status_code=201)
async def create_workflow(
body: WorkflowDefinitionCreate,
_user: User = Depends(require_admin),