From 7ccaed7313c7dd4d3873cff9e5b56c7abd6ae8f2 Mon Sep 17 00:00:00 2001 From: mi1468 Date: Tue, 27 May 2025 14:34:02 +0330 Subject: [PATCH] get spaces --- core/views/spaceView.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)