From d36e48ed7f6e2a7f00629983877f25d82d7b1077 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Wed, 25 Feb 2026 13:30:57 -0500 Subject: [PATCH] fix: add is_flow_synced and source_tree_name to step list response Co-Authored-By: Claude Sonnet 4.6 --- backend/app/api/endpoints/steps.py | 5 ++++- backend/app/schemas/step_library.py | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/app/api/endpoints/steps.py b/backend/app/api/endpoints/steps.py index 340a8451..874dc82f 100644 --- a/backend/app/api/endpoints/steps.py +++ b/backend/app/api/endpoints/steps.py @@ -5,6 +5,7 @@ from decimal import Decimal from fastapi import APIRouter, Depends, HTTPException, Query from sqlalchemy import select, func, desc, Integer, case from sqlalchemy.ext.asyncio import AsyncSession +from sqlalchemy.orm import selectinload from app.core.database import get_db from app.api.deps import get_current_active_user, require_engineer_or_admin @@ -72,7 +73,7 @@ async def list_steps( query = select(StepLibrary).where( StepLibrary.is_active == True, build_step_visibility_filter(current_user) - ) + ).options(selectinload(StepLibrary.source_tree)) # Apply filters if visibility: @@ -117,6 +118,8 @@ async def list_steps( "is_featured": step.is_featured, "created_by": step.created_by, "created_at": step.created_at, + "is_flow_synced": step.is_flow_synced, + "source_tree_name": step.source_tree.name if step.source_tree else None, } # Get category name if exists diff --git a/backend/app/schemas/step_library.py b/backend/app/schemas/step_library.py index e839c9dc..ebc1eae6 100644 --- a/backend/app/schemas/step_library.py +++ b/backend/app/schemas/step_library.py @@ -82,6 +82,8 @@ class StepLibraryListResponse(BaseModel): created_by: UUID author_name: Optional[str] = None created_at: datetime + is_flow_synced: bool = False + source_tree_name: Optional[str] = None class Config: from_attributes = True