From 2b2226ffb9046ace6ffc3ce2c5819a713d299016 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 11 Apr 2025 17:24:04 -0300 Subject: [PATCH] fix: Standardize endpoint paths in files v2 API (#7595) fix: standardize endpoint paths in files API Updated the file API routes to include trailing slashes for consistency. This change affects the upload, list, and delete endpoints, ensuring they all follow the same URL structure. --- src/backend/base/langflow/api/v2/files.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backend/base/langflow/api/v2/files.py b/src/backend/base/langflow/api/v2/files.py index c76e5ceb4..0672a3969 100644 --- a/src/backend/base/langflow/api/v2/files.py +++ b/src/backend/base/langflow/api/v2/files.py @@ -42,6 +42,7 @@ async def fetch_file_object(file_id: uuid.UUID, current_user: CurrentActiveUser, @router.post("", status_code=HTTPStatus.CREATED) +@router.post("/", status_code=HTTPStatus.CREATED) async def upload_user_file( file: Annotated[UploadFile, File(...)], session: DbSession, @@ -142,6 +143,7 @@ async def upload_user_file( @router.get("") +@router.get("/", status_code=HTTPStatus.OK) async def list_files( current_user: CurrentActiveUser, session: DbSession, @@ -239,6 +241,7 @@ async def delete_file( @router.delete("") +@router.delete("/", status_code=HTTPStatus.OK) async def delete_all_files( current_user: CurrentActiveUser, session: DbSession,