Adding completed_at and winners to g ames

This commit is contained in:
ryan
2026-01-24 09:57:25 -05:00
parent e431ba45e9
commit d4345a4e09
5 changed files with 159 additions and 27 deletions

View File

@@ -4,6 +4,16 @@ from backend.models import db, Team
bp = Blueprint('teams', __name__, url_prefix='/api/teams')
@bp.route('/past-names', methods=['GET'])
def get_past_team_names():
"""Get distinct team names from past games"""
past_names = db.session.query(Team.name)\
.distinct()\
.order_by(Team.name)\
.all()
return jsonify([name[0] for name in past_names]), 200
@bp.route('/<int:team_id>', methods=['DELETE'])
def delete_team(team_id):
"""Delete a team"""