Coverage for mpcforces_extractor\api\routes\subcases.py: 88%
8 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-06 21:34 +0100
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-06 21:34 +0100
1from typing import List
2from fastapi import APIRouter, Depends
3from mpcforces_extractor.api.dependencies import get_db
4from mpcforces_extractor.api.db.database import SubcaseDBModel
6router = APIRouter()
9@router.get("", response_model=List[SubcaseDBModel])
10async def get_subcases(db=Depends(get_db)) -> List[SubcaseDBModel]:
11 """Get all subcases"""
12 return await db.get_subcases()