eksplicit mapping af envs
This commit is contained in:
14
backend/app/api/stats.py
Normal file
14
backend/app/api/stats.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from fastapi import APIRouter, Depends
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.core.database import get_db
|
||||
from app.models.stats import StatsResponse
|
||||
from app.services import stats_service
|
||||
|
||||
router = APIRouter(tags=["stats"])
|
||||
|
||||
|
||||
@router.get("", response_model=StatsResponse)
|
||||
async def get_stats(db: AsyncSession = Depends(get_db)) -> StatsResponse:
|
||||
data = await stats_service.get_stats(db)
|
||||
return StatsResponse(**data)
|
||||
Reference in New Issue
Block a user