Skip to content

Commit

Permalink
Merge pull request #359 from perftools/default-page
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc authored Oct 24, 2020
2 parents 4b23b4e + 44fa536 commit 64a3b9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Xhgui/Controller/RunController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public function index(Request $request, Response $response)

$result = $this->searcher->getAll([
'sort' => $sort,
'page' => $request->get('page'),
'page' => (int)$request->get('page', SearcherInterface::DEFAULT_PAGE),
'direction' => $request->get('direction'),
'perPage' => $this->app->config('page.limit'),
'perPage' => (int)$this->app->config('page.limit'),
'conditions' => $search,
'projection' => true,
]);
Expand Down
1 change: 1 addition & 0 deletions src/Xhgui/Searcher/SearcherInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
interface SearcherInterface
{
const DEFAULT_DIRECTION = 'desc';
const DEFAULT_PAGE = 1;

/**
* Get the latest profile data.
Expand Down

0 comments on commit 64a3b9e

Please sign in to comment.