add context to related products

This commit is contained in:
2025-09-23 08:59:21 +00:00
parent beb49255e7
commit 26970f3f12

View File

@@ -65,7 +65,7 @@ class ProductViewSet(viewsets.ModelViewSet):
# TODO: find the most similar products # TODO: find the most similar products
product = self.get_object() product = self.get_object()
qs = get_related_products(product) qs = get_related_products(product)
serializer = self.serializer_class(qs, many=True) serializer = self.serializer_class(qs, many=True, context={'request': request})
return Response(data=serializer.data) return Response(data=serializer.data)