From c53ad3a69b89024f4a3cef11c3a8752e2e1e2719 Mon Sep 17 00:00:00 2001 From: Maxime Vergez Date: Wed, 4 Jan 2023 15:41:31 +0100 Subject: [PATCH] fix(api): page - 1 that returned the wrong page --- backend/gn_module_monitoring/utils/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/gn_module_monitoring/utils/routes.py b/backend/gn_module_monitoring/utils/routes.py index 0102f323c..e5adabab0 100644 --- a/backend/gn_module_monitoring/utils/routes.py +++ b/backend/gn_module_monitoring/utils/routes.py @@ -22,7 +22,7 @@ def paginate(query: Query, schema: Schema, limit: int, page: int) -> Response: result = query.paginate(page=page, error_out=False, per_page=limit) pagination_schema = paginate_schema(schema) data = pagination_schema().dump( - dict(items=result.items, count=result.total, limit=limit, offset=page - 1) + dict(items=result.items, count=result.total, limit=limit, offset=page) ) return jsonify(data)