Feat: more conformations and fixes

This commit is contained in:
ayntk-ai
2024-09-05 17:54:32 +02:00
parent 08df814408
commit fc3c69f687
12 changed files with 174 additions and 48 deletions

View File

@@ -10,6 +10,8 @@ use App\Models\Server;
use App\Models\StandaloneDocker;
use Livewire\Component;
use Visus\Cuid2\Cuid2;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Auth;
class Destination extends Component
{
@@ -115,8 +117,13 @@ class Destination extends Component
ApplicationStatusChanged::dispatch(data_get($this->resource, 'environment.project.team.id'));
}
public function removeServer(int $network_id, int $server_id)
public function removeServer(int $network_id, int $server_id, $password)
{
if (!Hash::check($password, Auth::user()->password)) {
$this->addError('password', 'The provided password is incorrect.');
return;
}
if ($this->resource->destination->server->id == $server_id && $this->resource->destination->id == $network_id) {
$this->dispatch('error', 'You cannot remove this destination server.', 'You are trying to remove the main server.');

View File

@@ -45,7 +45,6 @@ class Show extends Component
return;
}
// Test deletion in more detail
$this->storage->delete();
$this->dispatch('refreshStorages');
}