fix order
This commit is contained in:
1 parent
ae4dbab3cc
commit
4dc6d98abf
3 files changed
+39
-4
No files matched your search
@@ -9,6 +9,7 @@ from apps.shop.selectors import *
|
||||
from rest_framework import generics
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
from django.db.models import Count
|
||||
from apps.shop.ordering import category_ordering
|
||||
from utils.tools import inline_serializer
|
||||
from utils import custom_permissions
|
||||
|
||||
@@ -164,7 +165,7 @@ class ProductsCategoryApi(APIView):
|
||||
|
||||
p_cate = ProductCategoryModel.objects.filter(
|
||||
sys_ws__uuid=get_user_workspace_uuid(request),
|
||||
).annotate(product_count=Count('product')).filter(product_count__gte=1)
|
||||
).annotate(product_count=Count('product')).filter(product_count__gte=1).order_by(*category_ordering())
|
||||
output = self.OutputSerializer(p_cate, many=True)
|
||||
|
||||
return Response(data=output.data, status=status.HTTP_200_OK)
|
||||
Reference in new issue
Block a user