Skip to content

Commit

Permalink
[DH-5652] Fix add golden sql error handling (#444)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcjc712 authored and DishenWang2023 committed May 7, 2024
1 parent 2c7e313 commit 701013b
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions dataherald/server/fastapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,14 +528,7 @@ def delete_golden_sql(self, golden_sql_id: str) -> dict:
def add_golden_sqls(
self, golden_sqls: List[GoldenSQLRequest]
) -> List[GoldenSQLResponse]:
created_records = self._api.add_golden_sqls(golden_sqls)

# Return a JSONResponse with status code 201 and the location header.
golden_sqls_as_dicts = [record.dict() for record in created_records]

return JSONResponse(
content=golden_sqls_as_dicts, status_code=status.HTTP_201_CREATED
)
return self._api.add_golden_sqls(golden_sqls)

def get_golden_sqls(
self, db_connection_id: str = None, page: int = 1, limit: int = 10
Expand Down

0 comments on commit 701013b

Please sign in to comment.