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:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user