refactor: split pagination logic from response models
- Extract pagination logic to separate util module - Update response models to use new pagination util - Fix pagination calculation edge cases Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -192,6 +192,7 @@ def create_pagination_metadata(total: int, page: int, page_size: int) -> "Pagina
|
||||
total_pages=total_pages,
|
||||
has_next_page=has_next_page,
|
||||
has_prev_page=has_prev_page,
|
||||
pagination_mode="offset",
|
||||
)
|
||||
|
||||
|
||||
@@ -302,4 +303,5 @@ def create_keyset_pagination_metadata(
|
||||
has_next_page=has_next_page,
|
||||
has_prev_page=False,
|
||||
cursor=next_cursor,
|
||||
pagination_mode="cursor",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user