The Appointments API endpoint must only return appointment records and no unavailabilities.

This commit is contained in:
alext 2018-04-13 14:54:50 +02:00
parent 7ee9f24f5a
commit baa2e58951

View file

@ -50,8 +50,16 @@ class Appointments extends API_V1_Controller {
{ {
try try
{ {
$condition = $id !== NULL ? 'id = ' . $id : NULL; $conditions = [
$appointments = $this->appointments_model->get_batch($condition, array_key_exists('aggregates', $_GET)); 'is_unavailable' => FALSE
];
if ($id !== NULL)
{
$conditions['id'] = $id;
}
$appointments = $this->appointments_model->get_batch($conditions, array_key_exists('aggregates', $_GET));
if ($id !== NULL && count($appointments) === 0) if ($id !== NULL && count($appointments) === 0)
{ {