Commit 9e289a9a authored by Ristylou Dolar's avatar Ristylou Dolar

Merge pull request #44 in RMS/api-main-service from risty-develop to dev

* commit 'cc981f5a':
  Modified sort condition
parents 4bed503c cc981f5a
......@@ -70,7 +70,7 @@ class ApplicationViewSet(viewsets.ModelViewSet):
)
# table ordering
if 'sort_field' and 'sort_order' in request.query_params:
if 'sort_order' in request.query_params and 'sort_field' in request.query_params:
queryset = tbl_ordering(
queryset, **request.query_params
)
......
......@@ -64,7 +64,7 @@ class APIEndpointViewSet(viewsets.ModelViewSet):
queryset = self.queryset.filter(deleted_at__exact=None)
# table ordering
if 'sort_field' and 'sort_order' in request.query_params:
if 'sort_order' in request.query_params and 'sort_field' in request.query_params:
queryset = tbl_ordering(
queryset, **request.query_params
)
......
......@@ -65,7 +65,7 @@ class APIServiceViewSet(viewsets.ModelViewSet):
queryset = self.queryset.filter(deleted_at__exact=None)
# table ordering
if 'sort_field' and 'sort_order' in request.query_params:
if 'sort_order' in request.query_params and 'sort_field' in request.query_params:
queryset = tbl_ordering(
queryset, **request.query_params
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment