mirror of
https://github.com/StepanovPlaton/torrent_backend.git
synced 2026-04-03 20:30:38 +04:00
Add game card
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user