Fakultas Ilmu Komputer UI

Provided nutritionist data in user serializer

parent 5f097fed
Pipeline #83961 passed with stages
in 16 minutes and 6 seconds
......@@ -34,6 +34,14 @@ class UserAuthSerializer(serializers.ModelSerializer):
result['transaction_status'] = last_active_cart.transaction_status
result['cart_id'] = last_active_cart.id
result['nutritionist'] = None
if instance.nutritionist is not None:
result['nutritionist'] = {
'full_name_and_degree': instance.nutritionist.full_name_and_degree,
'phone_number': instance.nutritionist.phone_number
}
return result
class Meta:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment