mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-03-28 20:33:33 -04:00
fix(pagination): Ensure page number is always at least 1 in apply_common_pagination
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user