Merge pull request #10475 from snipe/fixes/wrong_default_sort_on_kits

Fixed assets_count doesnt exist as a column on kits
This commit is contained in:
snipe 2021-12-30 13:02:12 -08:00 committed by GitHub
commit 548e483ef8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,8 +31,8 @@ class PredefinedKitsController extends Controller
$offset = $request->input('offset', 0);
$limit = $request->input('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'assets_count';
$order = $request->input('order') === 'desc' ? 'desc' : 'asc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'name';
$kits->orderBy($sort, $order);
$total = $kits->count();