mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: project create/update endpoint to be simillar to list (#2476)
* chore: project create endpoint to be simillar to list * dev: make project create and update response same
This commit is contained in:
parent
4e86110123
commit
3e706f9653
@ -273,12 +273,9 @@ class ProjectViewSet(BaseViewSet):
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
data = serializer.data
|
project = self.get_queryset().filter(pk=serializer.data["id"]).first()
|
||||||
# Additional fields of the member
|
serializer = ProjectListSerializer(project)
|
||||||
data["sort_order"] = project_member.sort_order
|
return Response(serializer.data, status=status.HTTP_201_CREATED)
|
||||||
data["member_role"] = project_member.role
|
|
||||||
data["is_member"] = True
|
|
||||||
return Response(data, status=status.HTTP_201_CREATED)
|
|
||||||
return Response(
|
return Response(
|
||||||
serializer.errors,
|
serializer.errors,
|
||||||
status=status.HTTP_400_BAD_REQUEST,
|
status=status.HTTP_400_BAD_REQUEST,
|
||||||
@ -328,6 +325,8 @@ class ProjectViewSet(BaseViewSet):
|
|||||||
color="#ff7700",
|
color="#ff7700",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
project = self.get_queryset().filter(pk=serializer.data["id"]).first()
|
||||||
|
serializer = ProjectListSerializer(project)
|
||||||
return Response(serializer.data, status=status.HTTP_200_OK)
|
return Response(serializer.data, status=status.HTTP_200_OK)
|
||||||
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user