Commit 87f656b0 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

fix: tools update

parent 489ef9b7
......@@ -188,10 +188,12 @@ class ToolsTable:
def update_tool_by_id(self, id: str, updated: dict) -> Optional[ToolModel]:
try:
with get_db() as db:
tool = db.get(Tool, id)
tool.update(**updated)
tool.updated_at = int(time.time())
db.query(Tool).filter_by(id=id).update(
{**updated, "updated_at": int(time.time())}
)
db.commit()
tool = db.query(Tool).get(id)
db.refresh(tool)
return ToolModel.model_validate(tool)
except:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment