16 lines
482 B
Python
16 lines
482 B
Python
from fastapi import APIRouter, Depends, HTTPException, status
|
|
from sqlalchemy.orm import Session
|
|
|
|
from app.db import get_db
|
|
from app.models.report_filing import query_filing
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("/reports/query")
|
|
def read_report_query(number: str = "", db: Session = Depends(get_db)) -> dict:
|
|
try:
|
|
return query_filing(db, number)
|
|
except ValueError as exc:
|
|
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(exc)) from exc
|