mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 02:26:58 +00:00
Fix API error
This commit is contained in:
@@ -137,7 +137,9 @@ abstract class Controller extends BaseController
|
||||
if (null !== $value) {
|
||||
$bag->set($integer, (int)$value);
|
||||
}
|
||||
if (null === $value && 'limit' === $integer && auth()->check()) {
|
||||
if (null === $value &&
|
||||
'limit' === $integer && // @phpstan-ignore-line
|
||||
auth()->check()) {
|
||||
// set default for user:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$bag->set($integer, $pageSize);
|
||||
|
@@ -73,9 +73,7 @@ class UpdateRequest extends FormRequest
|
||||
if (null !== $reps) {
|
||||
$return['repetitions'] = $reps;
|
||||
}
|
||||
if (null !== $transactions) {
|
||||
$return['transactions'] = $transactions;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
@@ -166,7 +166,7 @@ class UpdateRequest extends FormRequest
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** @var array $transaction */
|
||||
/** @var array|null $transaction */
|
||||
foreach ($transactions as $transaction) {
|
||||
if (!is_array($transaction)) {
|
||||
throw new FireflyException('Invalid data submitted: transaction is not array.');
|
||||
|
@@ -113,7 +113,7 @@ class CorrectOpeningBalanceCurrencies extends Command
|
||||
$transactions = $journal->transactions()->get();
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($transactions as $transaction) {
|
||||
/** @var Account $account */
|
||||
/** @var Account|null $account */
|
||||
$account = $transaction->account()->first();
|
||||
if (null !== $account && AccountType::INITIAL_BALANCE !== $account->accountType()->first()->type) {
|
||||
return $account;
|
||||
|
@@ -42,7 +42,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
public function boot(): void
|
||||
{
|
||||
Schema::defaultStringLength(191);
|
||||
Response::macro('api', static function (array $value) {
|
||||
Response::macro('api', function (array $value) {
|
||||
$headers = [
|
||||
'Cache-Control' => 'no-store',
|
||||
];
|
||||
|
Reference in New Issue
Block a user