openfun / joanie

👛 A headless ERP for education to manage course enrollment/subscription, payment and certificates delivery.
MIT License
22 stars 2 forks source link

♻️(backend) use same serializer for product and course relations #744

Closed jbpenrath closed 5 months ago

jbpenrath commented 6 months ago

Purpose

Previously, we were using specific serializers to bind course relations and product relations in respective serializers. Now, we would like to be able to create/update product's course relations but the route in charge to create those relations is a nested one under course resource so currently course information are not returned in the response but we need those information from product detail view. That's why we decided to share the same serializer to return relation of Course or Product.

Proposal