Skip to content

Commit d957bd8

Browse files
committed
Fixed discrepancy between #165 and later PR
1 parent 45d9725 commit d957bd8

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

appointment/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
__url__ = "https://github.com/adamspd/django-appointment"
77
__package_website__ = "https://django-appt.adamspierredavid.com/"
88
__package_doc_url__ = "https://django-appt-doc.adamspierredavid.com/overview.html"
9-
__version__ = "3.5.0"
9+
__version__ = "3.5.1"
1010
__test_version__ = False

appointment/services.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,7 @@ def handle_service_management_request(post_data, files_data=None, service_id=Non
561561

562562
def create_new_appointment(data, request):
563563
service = Service.objects.get(id=data.get("service_id"))
564-
print(f"service id {data.get('service_id')}")
565-
print(f"Service: {service}")
566-
staff_id = data.get("staff_id")
564+
staff_id = data.get("staff_member")
567565
if staff_id:
568566
staff_member = StaffMember.objects.get(id=staff_id)
569567
else:
@@ -618,7 +616,7 @@ def create_new_appointment(data, request):
618616
def update_existing_appointment(data, request):
619617
try:
620618
appt = Appointment.objects.get(id=data.get("appointment_id"))
621-
staff_id = data.get("staff_id")
619+
staff_id = data.get("staff_member")
622620
want_reminder = data.get("want_reminder") == 'true'
623621
appt = save_appointment(
624622
appt,

appointment/static/js/app_admin/staff_index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ async function populateStaffMembers(selectedStaffId, isEditMode = false) {
461461

462462
// Function to fetch services for a specific staff member
463463
async function fetchServicesForStaffMember(staffId) {
464-
const url = `${fetchServiceListForStaffURL}?staff_id=${staffId}`;
464+
const url = `${fetchServiceListForStaffURL}?staff_member=${staffId}`;
465465
try {
466466
const response = await fetch(url);
467467
if (!response.ok) throw new Error('Network response was not ok');
@@ -779,7 +779,7 @@ function collectFormDataFromModal(modal) {
779779
};
780780

781781
if (staffId) {
782-
data.staff_id = staffId;
782+
data.staff_member = staffId;
783783
}
784784

785785
inputs.forEach(input => {

appointment/static/js/appointments.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ function fetchNonWorkingDays(staffId, callback) {
158158
return; // Exit the function early
159159
}
160160
let ajaxData = {
161-
'staff_id': staffId,
161+
'staff_member': staffId,
162162
};
163163

164164
$.ajax({

appointment/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def get_available_slots_ajax(request):
5959
"""
6060

6161
slot_form = SlotForm(request.GET)
62+
error_code = 0
6263
if not slot_form.is_valid():
6364
custom_data = {'error': True, 'available_slots': [], 'date_chosen': ''}
6465
if 'selected_date' in slot_form.errors:
@@ -114,7 +115,7 @@ def get_next_available_date_ajax(request, service_id):
114115
:param service_id: The ID of the service.
115116
:return: A JSON response containing the next available date.
116117
"""
117-
staff_id = request.GET.get('staff_id')
118+
staff_id = request.GET.get('staff_member')
118119

119120
# If staff_id is not provided, you should handle it accordingly.
120121
if staff_id and staff_id != 'none':
@@ -156,8 +157,7 @@ def get_next_available_date_ajax(request, service_id):
156157

157158

158159
def get_non_working_days_ajax(request):
159-
staff_id = request.GET.get('staff_id')
160-
print(f"staff_id: {staff_id}")
160+
staff_id = request.GET.get('staff_member')
161161
error = False
162162
message = _('Successfully retrieved non-working days')
163163

appointment/views_admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def add_or_update_staff_info(request, user_id=None):
231231
@require_staff_or_superuser
232232
def fetch_service_list_for_staff(request):
233233
appointment_id = request.GET.get('appointmentId')
234-
staff_id = request.GET.get('staff_id')
234+
staff_id = request.GET.get('staff_member')
235235
if appointment_id:
236236
# Fetch services for a specific appointment (edit mode)
237237
if request.user.is_superuser:

0 commit comments

Comments
 (0)