diff --git a/core/views/spaceView.py b/core/views/spaceView.py index 462a8d3..c63c788 100644 --- a/core/views/spaceView.py +++ b/core/views/spaceView.py @@ -13,7 +13,6 @@ from core.serializers.SpaceSerializer import SpaceSerializer - @api_view(['GET']) @authentication_classes([SessionAuthentication, TokenAuthentication]) @permission_classes([IsAuthenticated]) @@ -22,9 +21,10 @@ def getSpaces(request): spaces = Space.objects.filter(userId=request.user).select_related('assetBundleRoomId') # Serialize the spaces and include all fields from the related AssetBundleRoom + # Pass 'assetBundleRoomId' as it will be automatically included by select_related serializer = SpaceSerializer(spaces, many=True) # Return the serialized data as a response return Response({ "spaces": serializer.data - }, status=status.HTTP_200_OK) \ No newline at end of file + }, status=status.HTTP_200_OK)