(hero_id: int, session: SessionDep)
| 65 | |
| 66 | @app.delete("/heroes/{hero_id}") |
| 67 | def delete_hero(hero_id: int, session: SessionDep): |
| 68 | hero = session.get(Hero, hero_id) |
| 69 | if not hero: |
| 70 | raise HTTPException(status_code=404, detail="Hero not found") |
| 71 | session.delete(hero) |
| 72 | session.commit() |
| 73 | return {"ok": True} |
nothing calls this directly
no test coverage detected