remove unused code
This commit is contained in:
parent
6820fcc084
commit
da0398f35d
1 changed files with 7 additions and 14 deletions
|
|
@ -14,7 +14,6 @@
|
|||
class Danger extends Component
|
||||
{
|
||||
public $resource;
|
||||
public $service;
|
||||
public $resourceName;
|
||||
public $projectUuid;
|
||||
public $environmentName;
|
||||
|
|
@ -31,9 +30,9 @@ public function mount()
|
|||
$this->modalId = new Cuid2;
|
||||
$this->projectUuid = data_get($parameters, 'project_uuid');
|
||||
$this->environmentName = data_get($parameters, 'environment_name');
|
||||
|
||||
|
||||
ray('Mount method called');
|
||||
|
||||
|
||||
if ($this->resource === null) {
|
||||
if (isset($parameters['service_uuid'])) {
|
||||
$this->resource = Service::where('uuid', $parameters['service_uuid'])->first();
|
||||
|
|
@ -42,23 +41,23 @@ public function mount()
|
|||
?? ServiceDatabase::where('uuid', $parameters['stack_service_uuid'])->first();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ray('Resource:', $this->resource);
|
||||
|
||||
|
||||
if ($this->resource === null) {
|
||||
ray('Resource is null');
|
||||
$this->resourceName = 'Unknown Resource';
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!method_exists($this->resource, 'type')) {
|
||||
ray('Resource does not have type() method');
|
||||
$this->resourceName = 'Unknown Resource';
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ray('Resource type:', $this->resource->type());
|
||||
|
||||
|
||||
switch ($this->resource->type()) {
|
||||
case 'application':
|
||||
$this->resourceName = $this->resource->name ?? 'Application';
|
||||
|
|
@ -102,7 +101,6 @@ public function delete($password)
|
|||
}
|
||||
|
||||
try {
|
||||
// $this->authorize('delete', $this->resource);
|
||||
$this->resource->delete();
|
||||
DeleteResourceJob::dispatch(
|
||||
$this->resource,
|
||||
|
|
@ -120,9 +118,4 @@ public function delete($password)
|
|||
return handleError($e, $this);
|
||||
}
|
||||
}
|
||||
|
||||
// public function render()
|
||||
// {
|
||||
// return view('livewire.project.shared.danger');
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue