Can now update order of accounts efficiently.

This commit is contained in:
James Cole
2021-03-07 16:19:14 +01:00
parent 91394553c3
commit e3161a8b9c
5 changed files with 179 additions and 30 deletions

View File

@@ -82,6 +82,7 @@ class ShowController extends Controller
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
// get list of accounts. Count it and split it.
$this->repository->sortAccounts();
$collection = $this->repository->getAccountsByType($types);
$count = $collection->count();
$accounts = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);

View File

@@ -62,7 +62,6 @@ class UpdateRequest extends FormRequest
'account_type' => $this->nullableString('type'),
'account_type_id' => null,
'currency_id' => $this->nullableInteger('currency_id'),
'order' => $this->integer('order'),
'currency_code' => $this->nullableString('currency_code'),
'virtual_balance' => $this->nullableString('virtual_balance'),
'iban' => $this->nullableString('iban'),
@@ -77,6 +76,9 @@ class UpdateRequest extends FormRequest
'interest' => $this->nullableString('interest'),
'interest_period' => $this->nullableString('interest_period'),
];
if(null !== $this->get('order')) {
$data['order'] = $this->integer('order');
}
$data = $this->appendLocationData($data, null);