fix(pagination): Ensure page number is always at least 1 in apply_common_pagination

This commit is contained in:
Jokob @NetAlertX
2026-03-27 06:51:17 +00:00
parent ec3e4c8988
commit 7305fd78e3

View File

@@ -47,7 +47,8 @@ def apply_common_pagination(data, options):
# --- PAGINATE ---
if options.page is not None and options.limit is not None:
effective_limit = min(options.limit, _MAX_LIMIT)
start = (options.page - 1) * effective_limit
page = max(1, options.page)
start = (page - 1) * effective_limit
end = start + effective_limit
data = data[start:end]