Fix invoice Search auto redirect

This commit is contained in:
Jérémy Munsch 2022-08-30 14:54:02 +02:00
parent ce6fcd7f83
commit 1fd09c6bec
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC

View file

@ -54,7 +54,7 @@ class InvoiceController extends Controller
if ($request->ajax()) {
return $view;
}
if (($models = $view->getData()['models'])->count() === 1) {
if ($request->search and ($models = $view->getData()['models'])->count() === 1) {
return \redirect()->route('invoices.edit', $models->first());
}
return view('invoices.index', $view->getData());