Skip to content

Commit 1e056b6

Browse files
Update seam/paginator.py
Co-authored-by: Evan Sosenko <evan@getseam.com>
1 parent a0dba87 commit 1e056b6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

seam/paginator.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,11 @@ def _cache_pagination(self, response: Dict[str, Any], page_key: str) -> None:
3939
pagination_dict = response.get("pagination", {})
4040

4141
if isinstance(pagination_dict, dict):
42-
pagination_obj = Pagination(
43-
has_next_page=pagination_dict.get("has_next_page", False),
44-
next_page_cursor=pagination_dict.get("next_page_cursor"),
45-
next_page_url=pagination_dict.get("next_page_url"),
42+
self._pagination_cache[page_key] = Pagination(
43+
has_next_page=pagination.get("has_next_page", False),
44+
next_page_cursor=pagination.get("next_page_cursor"),
45+
next_page_url=pagination.get("next_page_url"),
4646
)
47-
self._pagination_cache[page_key] = pagination_obj
4847

4948
def first_page(self) -> Tuple[List[Any], Pagination | None]:
5049
"""Fetches the first page of results."""

0 commit comments

Comments
 (0)