mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
This fixes #273
This commit is contained in:
@@ -52,9 +52,9 @@ class AccountCrud implements AccountCrudInterface
|
|||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function destroy(Account $account, Account $moveTo = null): bool
|
public function destroy(Account $account, Account $moveTo): bool
|
||||||
{
|
{
|
||||||
if (!is_null($moveTo)) {
|
if (!is_null($moveTo->id)) {
|
||||||
// update all transactions:
|
// update all transactions:
|
||||||
DB::table('transactions')->where('account_id', $account->id)->update(['account_id' => $moveTo->id]);
|
DB::table('transactions')->where('account_id', $account->id)->update(['account_id' => $moveTo->id]);
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ class AccountCrud implements AccountCrudInterface
|
|||||||
{
|
{
|
||||||
$account = $this->user->accounts()->find($accountId);
|
$account = $this->user->accounts()->find($accountId);
|
||||||
if (is_null($account)) {
|
if (is_null($account)) {
|
||||||
$account = new Account;
|
return new Account;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $account;
|
return $account;
|
||||||
|
|||||||
Reference in New Issue
Block a user