feat: Add pagination with total count to generation listings and enable filtering assets by type.

This commit is contained in:
xds
2026-02-08 02:13:59 +03:00
parent aa50b1cc03
commit 31893414eb
14 changed files with 30 additions and 9 deletions

View File

@@ -66,9 +66,9 @@ async def delete_asset(
@router.get("")
async def get_assets(request: Request, dao: DAO = Depends(get_dao), limit: int = 10, offset: int = 0) -> AssetsResponse:
async def get_assets(request: Request, dao: DAO = Depends(get_dao), type: Optional[str] = None, limit: int = 10, offset: int = 0) -> AssetsResponse:
logger.info(f"get_assets called. Limit: {limit}, Offset: {offset}")
assets = await dao.assets.get_assets(limit, offset)
assets = await dao.assets.get_assets(type, limit, offset)
# assets = await dao.assets.get_assets() # This line seemed redundant/conflicting in original code
total_count = await dao.assets.get_asset_count()