Add game card

This commit is contained in:
2024-05-11 11:00:51 +04:00
parent fd5b19e6a9
commit 6ea6abad41
6 changed files with 35 additions and 25 deletions

View File

@@ -14,6 +14,14 @@ async def get_games(db: AsyncSession = Depends(get_session)):
raise HTTPException(500)
@games_router.get("/cards", response_model=list[GameCard])
async def get_games_cards(db: AsyncSession = Depends(get_session)):
try:
return await crud.get_games(db)
except Exception:
raise HTTPException(500)
@games_router.get("/{game_id}", response_model=Game)
async def get_game(game_id: int, db: AsyncSession = Depends(get_session)):
return await crud.get_game(db, game_id)