mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-11 00:16:54 +00:00
Add limit param to all endpoints
This commit is contained in:
@@ -57,12 +57,13 @@ class ListController extends Controller
|
||||
*/
|
||||
public function index(DateRequest $request, Budget $budget): JsonResponse
|
||||
{
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$dates = $request->getAll();
|
||||
$collection = $this->repository->getBudgetLimits($budget, $dates['start'], $dates['end']);
|
||||
$total = $collection->count();
|
||||
$collection->slice($this->pageSize * $this->parameters->get('page'), $this->pageSize);
|
||||
$collection->slice($pageSize * $this->parameters->get('page'), $pageSize);
|
||||
|
||||
$paginator = new LengthAwarePaginator($collection, $total, $this->pageSize, $this->parameters->get('page'));
|
||||
$paginator = new LengthAwarePaginator($collection, $total, $pageSize, $this->parameters->get('page'));
|
||||
$transformer = new BudgetLimitTransformer();
|
||||
|
||||
return response()
|
||||
|
||||
Reference in New Issue
Block a user