add context to related products
This commit is contained in:
@@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user