fix: flow export endpoint exporting folder (#3227)

Fixed flows export function exporting folder instead of flow when flow count is 1
This commit is contained in:
Lucas Oliveira 2024-08-07 15:20:32 -03:00 committed by GitHub
commit 10af38823e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,7 +16,7 @@ from loguru import logger
from sqlmodel import Session, and_, col, select
from langflow.api.utils import remove_api_keys, validate_is_component
from langflow.api.v1.schemas import FlowListCreate, FlowListRead
from langflow.api.v1.schemas import FlowListCreate
from langflow.initial_setup.setup import STARTER_FOLDER_NAME
from langflow.services.auth.utils import get_current_active_user
from langflow.services.database.models.flow import Flow, FlowCreate, FlowRead, FlowUpdate
@ -395,4 +395,4 @@ async def download_multiple_file(
headers={"Content-Disposition": f"attachment; filename={filename}"},
)
else:
return FlowListRead(flows=flows_without_api_keys)
return flows_without_api_keys[0]