From 387e02931e2c57acd62c119e8682cd140d9f9d8e Mon Sep 17 00:00:00 2001 From: Hironsan Date: Tue, 8 Feb 2022 11:50:09 +0900 Subject: [PATCH] Fix ProgressAPI to return response --- backend/metrics/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/metrics/views.py b/backend/metrics/views.py index 1b9fde4f..4ed1e121 100644 --- a/backend/metrics/views.py +++ b/backend/metrics/views.py @@ -18,8 +18,9 @@ class ProgressAPI(APIView): def get(self, request, *args, **kwargs): examples = Example.objects.filter(project=self.kwargs["project_id"]).values("id") total = examples.count() - done = ExampleState.objects.count_done(examples, user=self.request.user) - return {"total": total, "remaining": total - done} + complete = ExampleState.objects.count_done(examples, user=self.request.user) + data = {"total": total, "remaining": total - complete, "complete": complete} + return Response(data=data, status=status.HTTP_200_OK) class MemberProgressAPI(APIView):