From: Michael Tremer Date: Tue, 3 Mar 2026 14:36:34 +0000 (+0000) Subject: api: Remove the deprecated calls to fetch reports X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bbbbba12564a1cf722acc0bd34342a97002260b7;p=dbl.git api: Remove the deprecated calls to fetch reports Signed-off-by: Michael Tremer --- diff --git a/src/dbl/api/lists.py b/src/dbl/api/lists.py index 563e09d..5e4b1b1 100644 --- a/src/dbl/api/lists.py +++ b/src/dbl/api/lists.py @@ -76,17 +76,6 @@ async def get_list_history( async def get_list_sources(list = fastapi.Depends(get_list_from_path)) -> typing.List[sources.Source]: return list.sources -@router.get("/{list}/reports", deprecated=True) -async def get_list_reports( - list = fastapi.Depends(get_list_from_path), - open: bool | None = None, - name: str | None = None, - limit: int | None = None -) -> typing.List[reports.Report]: - reports = backend.reports.get(list=list, open=open, name=name, limit=limit) - - return [report async for report in reports] - @router.get("/{list}/domains/{name}") async def get_list_domains( name: str, list = fastapi.Depends(get_list_from_path), @@ -94,30 +83,5 @@ async def get_list_domains( # Fetch the domain history return [e async for e in list.get_domain_history(name)] - -class CreateReport(pydantic.BaseModel): - # Domain - name : str - - # Comment - comment : str = "" - - # Block? - block : bool = True - - -@router.post("/{list}/reports", deprecated=True) -async def list_report( - report: CreateReport, - list = fastapi.Depends(get_list_from_path), - user = fastapi.Depends(require_current_user), -) -> reports.Report: - return await list.report( - name = report.name, - reported_by = user, - comment = report.comment, - block = report.block, - ) - # Include our endpoints app.include_router(router)