feat: Add pagination with total count to generation listings and enable filtering assets by type.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user