From d59ffaf0bd6a3612331fc0d0cf960681851897c5 Mon Sep 17 00:00:00 2001 From: fadingNA Date: Sat, 9 Nov 2024 14:57:15 -0500 Subject: [PATCH] fix sorting on /sources --- application/api/user/routes.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/application/api/user/routes.py b/application/api/user/routes.py index 7d44ce9b..b3062005 100644 --- a/application/api/user/routes.py +++ b/application/api/user/routes.py @@ -485,8 +485,6 @@ class CombinedJson(Resource): @api.doc(description="Provide JSON file with combined available indexes") def get(self): user = "local" - sort_field = request.args.get("sort", "date") # Default to 'date' - sort_order = request.args.get("order", "desc") # Default to 'desc' data = [ { "name": "default", @@ -500,7 +498,7 @@ class CombinedJson(Resource): try: for index in sources_collection.find({"user": user}).sort( - sort_field, 1 if sort_order == "asc" else -1 + "date", -1 ): data.append( {