Add product review model, serializer, and API endpoint

Introduces a Review model for product reviews, including rating and comment fields. Adds a public serializer and a ModelViewSet for reviews with search and ordering capabilities. Also updates the frontend API client to use the correct token refresh endpoint and improves FormData handling.
This commit is contained in:
2026-01-14 00:10:46 +01:00
parent 2213e115c6
commit 98426f8b05
4 changed files with 47 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ from rest_framework import serializers
from thirdparty.stripe.client import StripeClient
from .models import Refund, Order, Invoice
from .models import Refund, Order, Invoice, Review
class RefundCreatePublicSerializer(serializers.Serializer):
@@ -465,3 +465,9 @@ class OrderReadSerializer(serializers.ModelSerializer):
return list(obj.discount.values_list("code", flat=True))
class ReviewSerializerPublic(serializers.Serializer):
class Meta:
model = Review
fields = "__all__"