chore: response changes of get and post

This commit is contained in:
NarayanBavisetti 2024-05-27 12:28:23 +05:30
parent 5fe135d1ac
commit 2e341c3f01
2 changed files with 3 additions and 15 deletions

View File

@ -48,10 +48,6 @@ class EstimatePointSerializer(BaseSerializer):
class EstimateReadSerializer(BaseSerializer):
points = EstimatePointSerializer(read_only=True, many=True)
workspace_detail = WorkspaceLiteSerializer(
read_only=True, source="workspace"
)
project_detail = ProjectLiteSerializer(read_only=True, source="project")
class Meta:
model = Estimate

View File

@ -95,16 +95,8 @@ class BulkEstimatePointEndpoint(BaseViewSet):
ignore_conflicts=True,
)
estimate_point_serializer = EstimatePointSerializer(
estimate_points, many=True
)
return Response(
{
"estimate_points": estimate_point_serializer.data,
},
status=status.HTTP_200_OK,
)
serializer = EstimateReadSerializer(estimate)
return Response(serializer.data, status=status.HTTP_200_OK)
def retrieve(self, request, slug, project_id, estimate_id):
estimate = Estimate.objects.get(
@ -166,7 +158,7 @@ class BulkEstimatePointEndpoint(BaseViewSet):
)
return Response(
{
"estimate_points": estimate_point_serializer.data,
"points": estimate_point_serializer.data,
},
status=status.HTTP_200_OK,
)