This commit is contained in:
Parsa Nazer
2025-01-14 19:27:31 +03:30
parent ab5e522617
commit f94c8d6cd0
+2 -2
View File
@@ -10,7 +10,7 @@ from rest_framework.permissions import IsAuthenticatedOrReadOnly
from utils.pagination import StructurePagination
from drf_spectacular.utils import extend_schema, OpenApiParameter
from drf_spectacular.types import OpenApiTypes
from rest_framework.permission_classes import AllowAny
from rest_framework.permissions import AllowAny
class AllCategories(APIView):
serializer_class = CategorySerializer
@@ -21,7 +21,7 @@ class AllCategories(APIView):
class ProductView(APIView):
serializer_class = ProductSerializer
permission_classes = AllowAny
permission_classes = [AllowAny]
def get(self, request, pk):
product = get_object_or_404(ProductModel, id=pk)
product_ser = self.serializer_class(instance=product, many=False)