MCPcopy Index your code
hub / github.com/fastapi/fastapi / delete_hero

Function delete_hero

docs_src/sql_databases/tutorial001_py310.py:63–69  ·  view source on GitHub ↗
(hero_id: int, session: Session = Depends(get_session))

Source from the content-addressed store, hash-verified

61
62@app.delete("/heroes/{hero_id}")
63def delete_hero(hero_id: int, session: Session = Depends(get_session)):
64 hero = session.get(Hero, hero_id)
65 if not hero:
66 raise HTTPException(status_code=404, detail="Hero not found")
67 session.delete(hero)
68 session.commit()
69 return {"ok": True}

Callers

nothing calls this directly

Calls 4

DependsClass · 0.90
HTTPExceptionClass · 0.90
getMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…