Compare commits

..

No commits in common. "577e87d8dbd36f9184f3e0bf09424950f38de210" and "1a84b8eb9956d5b9d1be13ff785a275361dfb2e9" have entirely different histories.

View File

@ -176,10 +176,9 @@ class AppointmentStatsView(generics.GenericAPIView):
class UserAppointmentStatsView(generics.GenericAPIView): class UserAppointmentStatsView(generics.GenericAPIView):
permission_classes = [IsAuthenticated] permission_classes = [IsAuthenticated]
def post(self, request): def get(self, request):
email = request.data.get('email')
stats = AppointmentRequest.objects.filter( stats = AppointmentRequest.objects.filter(
email=email email=request.user.email
).aggregate( ).aggregate(
total=Count('id'), total=Count('id'),
pending=Count('id', filter=Q(status='pending_review')), pending=Count('id', filter=Q(status='pending_review')),