diff --git a/appointments/views.py b/appointments/views.py index 1a52ff2..bf487fd 100644 --- a/appointments/views.py +++ b/appointments/views.py @@ -15,9 +15,11 @@ def create_appointment(request): try: data = json.loads(request.body) logger.info(f"Request data: {data}") - doctor_id = data.get('doctor') - patient_id = data.get('patient') - appointment_date = parse_datetime(data.get('scheduled_time')) + doctor_id = data.get('doctor_id') + patient_id = data.get('patient_id') + appointment_date_str = data.get('appointment_date') + logger.info(f"Type of appointment_date_str: {type(appointment_date_str)}") + appointment_date = parse_datetime(appointment_date_str) if appointment_date_str else None symptoms = data.get('symptoms') doctor = Doctor.objects.get(id=doctor_id)