mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 05:04:07 -08:00
Eager load adminuser
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
eb6f05faf7
commit
f283b5fbe8
|
@ -52,7 +52,9 @@ class CategoriesController extends Controller
|
||||||
'require_acceptance',
|
'require_acceptance',
|
||||||
'checkin_email',
|
'checkin_email',
|
||||||
'image',
|
'image',
|
||||||
])->withCount('accessories as accessories_count', 'consumables as consumables_count', 'components as components_count', 'licenses as licenses_count');
|
])
|
||||||
|
->with('adminuser')
|
||||||
|
->withCount('accessories as accessories_count', 'consumables as consumables_count', 'components as components_count', 'licenses as licenses_count');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -109,7 +111,7 @@ class CategoriesController extends Controller
|
||||||
$limit = app('api_limit_value');
|
$limit = app('api_limit_value');
|
||||||
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
|
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
|
||||||
$sort_override = $request->input('sort');
|
$sort_override = $request->input('sort');
|
||||||
$column_sort = in_array($sort_override, $allowed_columns) ? $sort_override : 'created_at';
|
$column_sort = in_array($sort_override, $allowed_columns) ? $sort_override : 'assets_count';
|
||||||
|
|
||||||
switch ($sort_override) {
|
switch ($sort_override) {
|
||||||
case 'created_by':
|
case 'created_by':
|
||||||
|
|
Loading…
Reference in a new issue