diff --git a/app/Http/Controllers/BaseAPIController.php b/app/Http/Controllers/BaseAPIController.php index 5b59a5b38b..45fe4d0de3 100644 --- a/app/Http/Controllers/BaseAPIController.php +++ b/app/Http/Controllers/BaseAPIController.php @@ -103,7 +103,7 @@ class BaseAPIController extends Controller $updatedAt = intval(Input::get('updated_at')); $query->where('updated_at', '>=', date('Y-m-d H:i:s', $updatedAt)); } - + if (Input::get('client_id') > 0) { $clientPublicId = Input::get('client_id'); $filter = function ($query) use ($clientPublicId) { @@ -213,6 +213,10 @@ class BaseAPIController extends Controller foreach ($included as $include) { if ($include == 'invoices') { $data[] = 'invoices.invoice_items'; + $data[] = 'invoices.client.contacts'; + } elseif ($include == 'invoice') { + $data[] = 'invoice.invoice_items'; + $data[] = 'invoice.client.contacts'; } elseif ($include == 'client') { $data[] = 'client.contacts'; } elseif ($include == 'clients') { diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index e5053551dc..7c1751091d 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -35,6 +35,7 @@ class Kernel extends HttpKernel \App\Http\Middleware\StartupCheck::class, ], 'api' => [ + \App\Http\Middleware\QueryLogging::class, \App\Http\Middleware\ApiCheck::class, ], /*