refactor(meetings): change UserAppointmentStatsView from GET to POST

Modified UserAppointmentStatsView to accept POST requests instead of GET
and retrieve email from request body rather than from authenticated user.
This allows querying appointment statistics for any email address instead
of being limited to the current user's email.

Changes:
- Changed HTTP method from GET to POST
- Added email parameter extraction from request.data
- Updated filter to use provided email instead of request.user.email
This commit is contained in:
saani 2025-11-26 16:03:09 +00:00
parent 4f07d854e1
commit ea99552d95

View File

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