From b7827f640c327aa8dd804ee5dc48b3a8436bef27 Mon Sep 17 00:00:00 2001 From: Spyros Date: Tue, 30 Jul 2024 15:38:01 +0100 Subject: [PATCH] add per_page parameter to get all cres --- application/web/web_main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/application/web/web_main.py b/application/web/web_main.py index 31173dd5..f928290a 100644 --- a/application/web/web_main.py +++ b/application/web/web_main.py @@ -651,11 +651,18 @@ def logout(): def all_cres() -> Any: database = db.Node_collection() page = 1 + per_page = ITEMS_PER_PAGE if request.args.get("page") is not None and int(request.args.get("page")) > 0: page = request.args.get("page") + if ( + request.args.get("per_page") is not None + and int(request.args.get("per_page")) > 0 + ): + per_page = request.args.get("per_page") + documents, page, total_pages = database.all_cres_with_pagination( - page, ITEMS_PER_PAGE + page, per_page=per_page ) if documents: res = [doc.todict() for doc in documents]