Added seperate courts
This commit is contained in:
@@ -60,3 +60,17 @@ async def delete_tournament(
|
||||
await send_ws_update(id)
|
||||
|
||||
return SUCCESS
|
||||
|
||||
|
||||
@router.patch("/{id}/courts", response_model=schemas.TournamentOut)
|
||||
def update_tournament_courts(
|
||||
id: str,
|
||||
court_ids: list[int],
|
||||
db: Session = Depends(get_db),
|
||||
user: dict = Depends(get_admin_user),
|
||||
):
|
||||
"""Updates the global courts assigned to a specific tournament"""
|
||||
t = crud.update_tournament_courts(db, id, court_ids)
|
||||
if not t:
|
||||
raise HTTPException(404, "Tournament not found")
|
||||
return t
|
||||
|
||||
Reference in New Issue
Block a user