feat: optimize code

This commit is contained in:
martsforever
2026-03-20 14:46:25 +08:00
parent 7b9d1253a5
commit ab073d09b3
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -23,7 +23,7 @@ def add_sqlmodel_route(app: FastAPI):
if user_dict.get("id") is None:
raise HTTPException(status_code=500, detail="Update row missing id")
update_user = (await session.exec(select(LlmUser).where(LlmUser.id == user_dict["id"]))).first()
update_user = (await session.execute(select(LlmUser).where(LlmUser.id == user_dict["id"]))).first()
if update_user is None:
raise HTTPException(status_code=500, detail="Update row not found")
@@ -41,7 +41,7 @@ def add_sqlmodel_route(app: FastAPI):
if user_dict.get("id") is None:
raise HTTPException(status_code=500, detail="Update row missing id")
delete_user: LlmUser = (await session.exec(select(LlmUser).where(LlmUser.id == user_dict["id"]))).first()
delete_user: LlmUser = (await session.execute(select(LlmUser).where(LlmUser.id == user_dict["id"]))).first()
if delete_user is None:
raise HTTPException(status_code=500, detail="Delete row not found")