diff --git a/murano/api/v1/__init__.py b/murano/api/v1/__init__.py index a794bb9d..8f1fd24e 100644 --- a/murano/api/v1/__init__.py +++ b/murano/api/v1/__init__.py @@ -19,7 +19,7 @@ stats = None SUPPORTED_PARAMS = ('order_by', 'category', 'marker', 'tag', 'class_name', 'limit', 'type', 'fqn', 'category', 'owned', 'search', - 'include_disabled') + 'include_disabled', 'sort_dir') LIST_PARAMS = ('category', 'tag', 'class', 'order_by') ORDER_VALUES = ('fqn', 'name', 'created') PKG_PARAMS_MAP = {'display_name': 'name', diff --git a/murano/db/catalog/api.py b/murano/db/catalog/api.py index e4a2e64e..dddc7d94 100644 --- a/murano/db/catalog/api.py +++ b/murano/db/catalog/api.py @@ -317,9 +317,11 @@ def package_search(filters, context, limit=None): sort_keys = [SEARCH_MAPPING[sort_key] for sort_key in filters.get('order_by', []) or ['created']] marker = filters.get('marker') + sort_dir = filters.get('sort_dir') if marker is not None: # set marker to real object instead of its id marker = _package_get(marker, session) - query = utils.paginate_query(query, pkg, limit, sort_keys, marker) + query = utils.paginate_query( + query, pkg, limit, sort_keys, marker, sort_dir) return query.all()