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