From bf9701769356e0b7081e82c597c798ffc83e2c4a Mon Sep 17 00:00:00 2001 From: chaplinthink Date: Wed, 7 Aug 2024 19:54:33 +0800 Subject: [PATCH] fix: Fix call list datasources api returns error Closes #1788 --- dbgpt/serve/datasource/api/endpoints.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/dbgpt/serve/datasource/api/endpoints.py b/dbgpt/serve/datasource/api/endpoints.py index 4401b32b4..57f4c4693 100644 --- a/dbgpt/serve/datasource/api/endpoints.py +++ b/dbgpt/serve/datasource/api/endpoints.py @@ -167,18 +167,14 @@ async def query( @router.get( "/datasources", dependencies=[Depends(check_api_key)], - response_model=Result[PaginationResult[DatasourceServeResponse]], + response_model=Result[List[DatasourceServeResponse]], ) -async def query_page( - page: int = Query(default=1, description="current page"), - page_size: int = Query(default=20, description="page size"), +async def query_list( service: Service = Depends(get_service), -) -> Result[PaginationResult[DatasourceServeResponse]]: +) -> Result[List[DatasourceServeResponse]]: """Query Space entities Args: - page (int): The page number - page_size (int): The page size service (Service): The service Returns: ServerResponse: The response