1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Eager load API data

This commit is contained in:
Hillel Coren 2018-02-26 12:04:25 +02:00
parent 0ac9054fed
commit 9664b0531d
2 changed files with 6 additions and 1 deletions

View File

@ -213,6 +213,10 @@ class BaseAPIController extends Controller
foreach ($included as $include) { foreach ($included as $include) {
if ($include == 'invoices') { if ($include == 'invoices') {
$data[] = 'invoices.invoice_items'; $data[] = 'invoices.invoice_items';
$data[] = 'invoices.client.contacts';
} elseif ($include == 'invoice') {
$data[] = 'invoice.invoice_items';
$data[] = 'invoice.client.contacts';
} elseif ($include == 'client') { } elseif ($include == 'client') {
$data[] = 'client.contacts'; $data[] = 'client.contacts';
} elseif ($include == 'clients') { } elseif ($include == 'clients') {

View File

@ -35,6 +35,7 @@ class Kernel extends HttpKernel
\App\Http\Middleware\StartupCheck::class, \App\Http\Middleware\StartupCheck::class,
], ],
'api' => [ 'api' => [
\App\Http\Middleware\QueryLogging::class,
\App\Http\Middleware\ApiCheck::class, \App\Http\Middleware\ApiCheck::class,
], ],
/* /*