(
*,
session: Session = Depends(get_session),
team_id: int,
team: TeamUpdate,
)
| 162 | |
| 163 | @app.patch("/teams/{team_id}", response_model=TeamPublic) |
| 164 | def update_team( |
| 165 | *, |
| 166 | session: Session = Depends(get_session), |
| 167 | team_id: int, |
| 168 | team: TeamUpdate, |
| 169 | ): |
| 170 | db_team = session.get(Team, team_id) |
| 171 | if not db_team: |
| 172 | raise HTTPException(status_code=404, detail="Team not found") |
| 173 | team_data = team.model_dump(exclude_unset=True) |
| 174 | db_team.sqlmodel_update(team_data) |
| 175 | session.add(db_team) |
| 176 | session.commit() |
| 177 | session.refresh(db_team) |
| 178 | return db_team |
| 179 | |
| 180 | |
| 181 | @app.delete("/teams/{team_id}") |
nothing calls this directly
no test coverage detected
searching dependent graphs…