Commit cc981f5a authored by Ristylou Dolar's avatar Ristylou Dolar

Modified sort condition

parent 4bed503c
......@@ -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