diff --git a/application/controllers/Calendar.php b/application/controllers/Calendar.php index 2efaa8f91..f915e8256 100644 --- a/application/controllers/Calendar.php +++ b/application/controllers/Calendar.php @@ -618,9 +618,10 @@ public function get_calendar_appointments(): void $record_id = request('record_id'); - $filter_type = request('filter_type'); $is_all = request('record_id') === FILTER_TYPE_ALL; + $filter_type = request('filter_type'); + if (!$filter_type && !$is_all) { json_response([ 'appointments' => [], @@ -680,7 +681,7 @@ public function get_calendar_appointments(): void // Get unavailability periods (only for provider). $response['unavailabilities'] = []; - if ($filter_type == FILTER_TYPE_PROVIDER) { + if ($filter_type == FILTER_TYPE_PROVIDER || $is_all) { $where_clause = $where_id . ' = ' .