Added seperate bracket/node logic
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
# backend/app/routes/tournaments/bracket.py
|
||||
from fastapi import Depends, HTTPException
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from ... import crud, schemas
|
||||
from ...database import get_db
|
||||
from . import router
|
||||
|
||||
|
||||
@router.get("/{id}/bracket", response_model=list[schemas.BracketNodeOut])
|
||||
def get_tournament_bracket(id: str, db: Session = Depends(get_db)):
|
||||
t = crud.get_tournament(db, id)
|
||||
if not t:
|
||||
raise HTTPException(404, "Tournament not found")
|
||||
return t.nodes
|
||||
Reference in New Issue
Block a user