From eeeb17fd282fe22a67e267352773311980555491 Mon Sep 17 00:00:00 2001 From: khalid Date: Wed, 25 Feb 2026 21:32:25 +0000 Subject: [PATCH] fix: v1 & v1_1 simulations endpoints --- src/simdb/remote/apis/v1/simulations.py | 2 +- src/simdb/remote/apis/v1_1/simulations.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/simdb/remote/apis/v1/simulations.py b/src/simdb/remote/apis/v1/simulations.py index d171513d..65338723 100644 --- a/src/simdb/remote/apis/v1/simulations.py +++ b/src/simdb/remote/apis/v1/simulations.py @@ -143,7 +143,7 @@ class SimulationList(Resource): @requires_auth() @cache.cached(key_prefix=cache_key) def get(self, user: User): - limit = int(request.headers.get(SimulationList.LIMIT_HEADER, 100)) + limit = int(request.headers.get(APIConstants.LIMIT_HEADER, 100)) page = 1 names = [] constraints = [] diff --git a/src/simdb/remote/apis/v1_1/simulations.py b/src/simdb/remote/apis/v1_1/simulations.py index 5bc1eadd..4a887491 100644 --- a/src/simdb/remote/apis/v1_1/simulations.py +++ b/src/simdb/remote/apis/v1_1/simulations.py @@ -158,12 +158,11 @@ class SimulationList(Resource): @requires_auth() @cache.cached(key_prefix=cache_key) def get(self, user: User): - limit = int(request.headers.get(SimulationList.LIMIT_HEADER, 100)) - page = int(request.headers.get(SimulationList.PAGE_HEADER, 1)) - sort_by = request.headers.get(SimulationList.SORT_BY_HEADER, "") + limit = int(request.headers.get(APIConstants.LIMIT_HEADER, 100)) + page = int(request.headers.get(APIConstants.PAGE_HEADER, 1)) + sort_by = request.headers.get(APIConstants.SORT_BY_HEADER, "") sort_asc = ( - request.headers.get(SimulationList.SORT_ASC_HEADER, "false").lower() - == "true" + request.headers.get(APIConstants.SORT_ASC_HEADER, "false").lower() == "true" ) names = [] constraints = []