This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
from typing import List
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from src.db.models.tysc import Card
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.tysc.card import CardResponse, to_response
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.get("/cards")
|
||||
def get_all_players(db: SessionDep) -> List[CardResponse]:
|
||||
results: List[CardResponse] = []
|
||||
cards = db.query(Card).all()
|
||||
for card in cards:
|
||||
response = to_response(card)
|
||||
results.append(response)
|
||||
return results
|
||||
Reference in New Issue
Block a user