open a few apis
This commit is contained in:
@@ -14,6 +14,7 @@ from rest_framework.permissions import AllowAny
|
||||
|
||||
class AllCategories(APIView):
|
||||
serializer_class = CategorySerializer
|
||||
authentication_classes = []
|
||||
def get(self, request):
|
||||
categories = CategoryModel.objects.all()
|
||||
categories_ser = self.serializer_class(instance=categories, many=True)
|
||||
@@ -22,6 +23,7 @@ class AllCategories(APIView):
|
||||
class ProductView(APIView):
|
||||
serializer_class = ProductSerializer
|
||||
permission_classes = [AllowAny]
|
||||
authentication_classes = []
|
||||
def get(self, request, pk):
|
||||
product = get_object_or_404(ProductModel, id=pk)
|
||||
product_ser = self.serializer_class(instance=product, many=False)
|
||||
@@ -30,7 +32,7 @@ class ProductView(APIView):
|
||||
class AllProductsView(APIView):
|
||||
serializer_class = ProductSerializer
|
||||
pagination_class = StructurePagination
|
||||
|
||||
authentication_classes = []
|
||||
@extend_schema(
|
||||
parameters=[
|
||||
OpenApiParameter(
|
||||
|
||||
Reference in New Issue
Block a user