fix: screen uses court_number, seed resets sequences
This commit is contained in:
@@ -15,8 +15,11 @@ router = APIRouter(prefix="/screen", tags=["screen"])
|
||||
|
||||
@router.get("/court/{court_id}")
|
||||
def get_court_display(court_id: int, db: Session = Depends(get_db)):
|
||||
"""Full court display data for TV screen"""
|
||||
court = db.query(Court).filter(Court.id == court_id).first()
|
||||
"""Full court display data for TV screen (court_id = court_number)"""
|
||||
# Try by court_number first (friendlier URLs), then by id
|
||||
court = db.query(Court).filter(Court.court_number == court_id).first()
|
||||
if not court:
|
||||
court = db.query(Court).filter(Court.id == court_id).first()
|
||||
if not court:
|
||||
return {"error": "Court not found"}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user