From 133021096a9d21151de16d364ed5864ac6a3aaa1 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 20 Mar 2023 12:09:00 +0300 Subject: auth: data: Enable offset in queries Enable the 'OFFSET' clause in the queries to allow for progressive fetching of data from the database using the 'Previous' and 'Next' buttons. --- gn3/auth/authorisation/groups/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gn3/auth/authorisation/groups/views.py') diff --git a/gn3/auth/authorisation/groups/views.py b/gn3/auth/authorisation/groups/views.py index 7b967d7..0b21800 100644 --- a/gn3/auth/authorisation/groups/views.py +++ b/gn3/auth/authorisation/groups/views.py @@ -177,7 +177,6 @@ def unlinked_data(resource_type: str) -> Response: f") {type_filter}") cursor.execute(ids_query) ids = cursor.fetchall() - print(f"THE IDS: {ids} ==> {type_filter}") if ids: clause = ", ".join(["(?, ?, ?)"] * len(ids)) @@ -204,7 +203,8 @@ def ungrouped_data(dataset_type: str) -> Response: with gn3dbutils.database_connection() as gn3conn: return jsonify(with_db_connection(partial( retrieve_ungrouped_data, gn3conn=gn3conn, - dataset_type=dataset_type))) + dataset_type=dataset_type, + offset = int(request.args.get("offset", 0))))) @groups.route("/data/link", methods=["POST"]) @require_oauth("profile group resource") -- cgit v1.2.3