diff --git a/flexiapi/app/Services/AccountService.php b/flexiapi/app/Services/AccountService.php index 09a386c..a860991 100644 --- a/flexiapi/app/Services/AccountService.php +++ b/flexiapi/app/Services/AccountService.php @@ -160,13 +160,12 @@ class AccountService $account->setRole($request->get('role')); } - if (!$request->api && $request->has('activated')) { - $account->activated = $request->get('activated') == 'true'; - } - - if (!$request->api && $request->has('blocked')) { - $account->blocked = in_array($request->get('blocked'), ['true', 'on']); - } + $account->activated = !$request->api + && $request->has('activated') + && in_array($request->get('activated'), ['true', 'on']); + $account->blocked = !$request->api + && $request->has('blocked') + && in_array($request->get('blocked'), ['true', 'on']); if ($request->get('password')) { $account->updatePassword( diff --git a/flexiapi/database/migrations/2025_03_13_135937_create_again_external_accounts_table.php b/flexiapi/database/migrations/2025_03_13_135937_create_again_external_accounts_table.php index f78e1c7..aaa2283 100644 --- a/flexiapi/database/migrations/2025_03_13_135937_create_again_external_accounts_table.php +++ b/flexiapi/database/migrations/2025_03_13_135937_create_again_external_accounts_table.php @@ -19,9 +19,9 @@ return new class extends Migration $table->string('outbound_proxy', 64)->nullable(); $table->string('protocol', 4)->default('UDP'); - $table->integer('account_id')->unsigned()->nullable(); + $table->integer('account_id')->unsigned(); $table->foreign('account_id')->references('id') - ->on('accounts')->onDelete('set null'); + ->on('accounts')->onDelete('cascade'); $table->timestamps(); }); diff --git a/flexiapi/resources/views/admin/account/create_edit.blade.php b/flexiapi/resources/views/admin/account/create_edit.blade.php index 1bcfd89..a37adf6 100644 --- a/flexiapi/resources/views/admin/account/create_edit.blade.php +++ b/flexiapi/resources/views/admin/account/create_edit.blade.php @@ -26,7 +26,6 @@

users {{ __('Create') }}

{{ __('Cancel') }} -
@endif @@ -124,7 +123,11 @@ @endif
- + @if ($account->id) + + @else + + @endif