Remove product method in BrandViewset

This commit is contained in:
jhyns 2023-05-18 12:22:01 +09:00
parent ffbb40e7d9
commit ec92e0b089

View File

@ -16,18 +16,9 @@ from market.serializers import (
class BrandViewset(ActionBasedMixin, ModelViewSet):
queryset = Brand.objects.all()
serializer_class = BrandSerializer
serializer_class_map = {
"products": ProductSerializer,
}
permission_classes = [IsAdminUserOrReadOnly]
pagination_class = None
@action(detail=True, methods=["GET"])
def product(self, request, pk):
queryset = self.get_object().products.all()
serializer = self.get_serializer(queryset, many=True)
return Response(serializer.data)
class ProductViewset(ActionBasedMixin, ModelViewSet):
queryset = (