diff --git a/application/controllers/Backend_api.php b/application/controllers/Backend_api.php index f80cf25b..2ab0f963 100755 --- a/application/controllers/Backend_api.php +++ b/application/controllers/Backend_api.php @@ -556,7 +556,7 @@ class Backend_api extends EA_Controller { $provider = $this->providers_model->find($unavailable['id_users_provider']); - $this->appointments_model->delete_unavailable($unavailable['id']); + $this->appointments_model->delete($unavailable['id']); // Google Sync try diff --git a/application/controllers/api/v1/Unavailabilities.php b/application/controllers/api/v1/Unavailabilities.php index a5f36757..b5c01c25 100644 --- a/application/controllers/api/v1/Unavailabilities.php +++ b/application/controllers/api/v1/Unavailabilities.php @@ -137,7 +137,7 @@ class Unavailabilities extends API_V1_Controller { } catch (Throwable $e) { - $this->handle_exception($exception); + $this->handle_exception($e); } } @@ -150,7 +150,7 @@ class Unavailabilities extends API_V1_Controller { { try { - $result = $this->appointments_model->delete_unavailable($id); + $result = $this->appointments_model->delete($id); $response = new Response([ 'code' => 200, diff --git a/application/models/Appointments_model.php b/application/models/Appointments_model.php index 1383302e..bd40bfc1 100644 --- a/application/models/Appointments_model.php +++ b/application/models/Appointments_model.php @@ -352,18 +352,6 @@ class Appointments_model extends EA_Model { } } - /** - * Remove an existing unavailable from the database. - * - * @param int $unavailable_id Record id to be deleted. - * - * @return bool Returns the delete operation result. - */ - public function delete_unavailable(int $unavailable_id): bool - { - return $this->db->delete('appointments', ['id' => $unavailable_id]); - } - /** * Remove all the Google Calendar event IDs from appointment records. *