mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-22 22:52:35 +03:00
The Appointments API endpoint must only return appointment records and no unavailabilities.
This commit is contained in:
parent
7ee9f24f5a
commit
baa2e58951
1 changed files with 10 additions and 2 deletions
|
@ -50,8 +50,16 @@ class Appointments extends API_V1_Controller {
|
|||
{
|
||||
try
|
||||
{
|
||||
$condition = $id !== NULL ? 'id = ' . $id : NULL;
|
||||
$appointments = $this->appointments_model->get_batch($condition, array_key_exists('aggregates', $_GET));
|
||||
$conditions = [
|
||||
'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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue