chore: fixed workspace list

This commit is contained in:
NarayanBavisetti 2023-12-13 00:59:35 +05:30
parent 4101a92f2e
commit 3da5817629
2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@
from rest_framework import serializers from rest_framework import serializers
# Module imports # Module imports
from .base import BaseSerializer from .base import BaseSerializer, DynamicBaseSerializer
from .user import UserLiteSerializer, UserAdminLiteSerializer from .user import UserLiteSerializer, UserAdminLiteSerializer
from plane.db.models import ( from plane.db.models import (
@ -16,7 +16,7 @@ from plane.db.models import (
) )
class WorkSpaceSerializer(BaseSerializer): class WorkSpaceSerializer(DynamicBaseSerializer):
owner = UserLiteSerializer(read_only=True) owner = UserLiteSerializer(read_only=True)
total_members = serializers.IntegerField(read_only=True) total_members = serializers.IntegerField(read_only=True)
total_issues = serializers.IntegerField(read_only=True) total_issues = serializers.IntegerField(read_only=True)

View File

@ -214,7 +214,7 @@ class UserWorkSpacesEndpoint(BaseAPIView):
fields=fields if fields else None, fields=fields if fields else None,
many=True, many=True,
).data ).data
workspace_dict = {str(workspaces["id"]): workspaces for workspace in workspaces} workspace_dict = {str(workspace["id"]): workspace for workspace in workspaces}
return Response(workspace_dict, status=status.HTTP_200_OK) return Response(workspace_dict, status=status.HTTP_200_OK)