Add page limit to auto complete

This commit is contained in:
James Cole 2021-01-26 19:27:27 +01:00
parent e3f174621c
commit 2f8113db6b
No known key found for this signature in database
GPG Key ID: B5669F9493CDE38D

View File

@ -46,9 +46,10 @@ class TransactionController extends Controller
public function search(Request $request, SearchInterface $searcher): JsonResponse
{
$manager = $this->getManager();
$fullQuery = (string) $request->get('query');
$page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page');
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$fullQuery = (string)$request->get('query');
$page = 0 === (int)$request->get('page') ? 1 : (int)$request->get('page');
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$pageSize = 0 === (int)$request->get('limit') ? $pageSize : (int)$request->get('limit');
$searcher->parseQuery($fullQuery);
$searcher->setPage($page);
$searcher->setLimit($pageSize);