diff --git a/app/Api/V1/Controllers/Data/DestroyController.php b/app/Api/V1/Controllers/Data/DestroyController.php index 18de6b961c..7da833a4b4 100644 --- a/app/Api/V1/Controllers/Data/DestroyController.php +++ b/app/Api/V1/Controllers/Data/DestroyController.php @@ -94,19 +94,39 @@ class DestroyController extends Controller case 'object_groups': $this->destroyObjectGroups(); break; + case 'not_assets_liabilities': + $this->destroyAccounts( + [ + AccountType::BENEFICIARY, + AccountType::CASH, + AccountType::CREDITCARD, + AccountType::DEFAULT, + AccountType::EXPENSE, + AccountType::IMPORT, + AccountType::INITIAL_BALANCE, + AccountType::LIABILITY_CREDIT, + AccountType::RECONCILIATION, + AccountType::REVENUE, + ] + ); + break; case 'accounts': $this->destroyAccounts( [ AccountType::ASSET, - AccountType::DEFAULT, AccountType::BENEFICIARY, - AccountType::EXPENSE, - AccountType::REVENUE, - AccountType::INITIAL_BALANCE, + AccountType::CASH, + AccountType::CREDITCARD, AccountType::DEBT, + AccountType::DEFAULT, + AccountType::EXPENSE, + AccountType::IMPORT, + AccountType::INITIAL_BALANCE, + AccountType::LIABILITY_CREDIT, AccountType::LOAN, AccountType::MORTGAGE, - AccountType::CREDITCARD, + AccountType::RECONCILIATION, + AccountType::REVENUE, ] ); break; diff --git a/app/Api/V1/Requests/Data/DestroyRequest.php b/app/Api/V1/Requests/Data/DestroyRequest.php index bc8026c703..299ecf138b 100644 --- a/app/Api/V1/Requests/Data/DestroyRequest.php +++ b/app/Api/V1/Requests/Data/DestroyRequest.php @@ -53,7 +53,8 @@ class DestroyRequest extends FormRequest public function rules(): array { $valid = 'budgets,bills,piggy_banks,rules,recurring,categories,tags,object_groups'. - ',accounts,asset_accounts,expense_accounts,revenue_accounts,liabilities,transactions,withdrawals,deposits,transfers'; + ',accounts,asset_accounts,expense_accounts,revenue_accounts,liabilities,transactions,withdrawals,deposits,transfers'. + ',not_assets_liabilities'; return [ 'objects' => sprintf('required|min:1|string|in:%s', $valid), diff --git a/resources/views/profile/index.twig b/resources/views/profile/index.twig index b2e2dbe23b..166a240404 100644 --- a/resources/views/profile/index.twig +++ b/resources/views/profile/index.twig @@ -318,7 +318,7 @@ url = '{{ route('api.v1.data.purge') }}'; } if (link.data('type') === 'unused_accounts') { - url = deleteAPIRoute + '?objects=accounts&unused=true'; + url = deleteAPIRoute + '?objects=not_assets_liabilities&unused=true'; } // replace icon with loading thing