Adding the game data to the event click response
This commit is contained in:
@@ -10,6 +10,11 @@ class GameSerializer(serializers.ModelSerializer):
|
||||
|
||||
|
||||
class GameEventSerializer(serializers.ModelSerializer):
|
||||
def to_representation(self, instance):
|
||||
response = super().to_representation(instance)
|
||||
response["active_game"] = GameSerializer(instance.game).data
|
||||
return response
|
||||
|
||||
class Meta:
|
||||
model = GameEvent
|
||||
fields = "__all__"
|
||||
|
||||
Reference in New Issue
Block a user