Unset foreach variable

This commit is contained in:
Alex Tselegidis 2024-04-26 16:40:33 +02:00
parent 5d823985de
commit 6e8778919e

View file

@ -621,8 +621,9 @@ class Calendar extends EA_Controller
$record_id = request('record_id');
$filter_type = request('filter_type');
$is_all = request('record_id') === FILTER_TYPE_ALL;
if (!$filter_type && $record_id !== FILTER_TYPE_ALL) {
if (!$filter_type && !$is_all) {
json_response([
'appointments' => [],
'unavailabilities' => [],
@ -676,6 +677,8 @@ class Calendar extends EA_Controller
$appointment['customer'] = $this->customers_model->find($appointment['id_users_customer']);
}
unset($appointment);
// Get unavailability periods (only for provider).
$response['unavailabilities'] = [];