Spaces:
Sleeping
Sleeping
File size: 448 Bytes
a5c1fa0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | """API endpoints that return paginated results."""
# TODO: import Paginator from query_builder
from src.query_builder import build_query
def list_items(table: str, page: int = 1, page_size: int = None) -> dict:
"""List items from a table with pagination."""
# TODO: use Paginator to paginate results
items = build_query(table)
return {
"items": items, # Should return only current page
"total": len(items),
}
|