Skip to content

Commit 9015560

Browse files
authored
docs: incorrect repository pagination example (#494)
Fix repository pagination example Signed-off-by: Jan Wytze Zuidema <[email protected]>
1 parent 0674fb9 commit 9015560

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/usage/repositories.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,11 @@ Pagination
118118
) -> tuple[list[Post], int]:
119119
repository = PostRepository(session=db_session)
120120
121+
offset = (page - 1) * page_size
122+
121123
# Get page of results and total count
122124
results, total = await repository.list_and_count(
123-
LimitOffset(offset=page, limit=page_size)
125+
LimitOffset(offset=offset, limit=page_size)
124126
)
125127
126128
return results, total

0 commit comments

Comments
 (0)