fix bug product list

This commit is contained in:
Parsa Nazer
2025-05-24 20:22:39 +03:30
parent 9ec74eef99
commit 11eab8c21b
+1 -1
View File
@@ -164,7 +164,7 @@ class AllProductsView(APIView):
products = ProductModel.objects.all() products = ProductModel.objects.all()
if category_slug: if category_slug:
if 'category' in category_slug: if 'category' not in category_slug:
sub_category = get_object_or_404(SubCategoryModel, slug=category_slug) sub_category = get_object_or_404(SubCategoryModel, slug=category_slug)
products = ProductModel.objects.filter(category=sub_category) products = ProductModel.objects.filter(category=sub_category)
else: else: