mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-03 20:57:19 -06:00
Add limit parameter to /budgets/x/transactions API endpoint.
This commit is contained in:
parent
d33c89a8ee
commit
163b0a2105
@ -247,7 +247,14 @@ class BudgetController extends Controller
|
||||
public function transactions(Request $request, Budget $budget): JsonResponse
|
||||
{
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$type = $request->get('type') ?? 'default';
|
||||
|
||||
// user can overrule page size with limit parameter.
|
||||
$limit = $this->parameters->get('limit');
|
||||
if (null !== $limit && $limit > 0) {
|
||||
$pageSize = $limit;
|
||||
}
|
||||
|
||||
$type = $request->get('type') ?? 'default';
|
||||
$this->parameters->set('type', $type);
|
||||
|
||||
$types = $this->mapTransactionTypes($this->parameters->get('type'));
|
||||
|
Loading…
Reference in New Issue
Block a user