Take page size into account. [skip ci]

This commit is contained in:
James Cole
2016-04-21 09:04:19 +02:00
parent 13e59105ec
commit 23c0bb49c4
3 changed files with 9 additions and 6 deletions

View File

@@ -155,11 +155,12 @@ class CategoryController extends Controller
public function show(SCRI $repository, Category $category)
{
$hideCategory = true; // used in list.
$pageSize = Preferences::get('transactionPageSize', 50)->data;
$page = intval(Input::get('page'));
$set = $repository->getJournals($category, $page);
$set = $repository->getJournals($category, $page, $pageSize);
$count = $repository->countJournals($category);
$subTitle = $category->name;
$journals = new LengthAwarePaginator($set, $count, 50, $page);
$journals = new LengthAwarePaginator($set, $count, $pageSize, $page);
$journals->setPath('categories/show/' . $category->id);
// list of ranges for list of periods: