diff --git a/app/Livewire/Team/Storage/Create.php b/app/Livewire/Team/Storage/Create.php index 82f93320b..a25fc9821 100644 --- a/app/Livewire/Team/Storage/Create.php +++ b/app/Livewire/Team/Storage/Create.php @@ -67,7 +67,8 @@ class Create extends Component $this->storage->save(); return redirect()->route('team.storage.show', $this->storage->uuid); } catch (\Throwable $e) { - return handleError($e, $this); + $this->dispatch('error', 'Failed to create storage.', $e->getMessage()); + // return handleError($e, $this); } } } diff --git a/app/Livewire/Team/Storage/Form.php b/app/Livewire/Team/Storage/Form.php index 8a26a3471..1fd0d470b 100644 --- a/app/Livewire/Team/Storage/Form.php +++ b/app/Livewire/Team/Storage/Form.php @@ -33,9 +33,9 @@ class Form extends Component { try { $this->storage->testConnection(shouldSave: true); - return $this->dispatch('success', 'Connection is working. Tested with "ListObjectsV2" action.'); + return $this->dispatch('success', 'Connection is working.', 'Tested with "ListObjectsV2" action.'); } catch (\Throwable $e) { - return handleError($e, $this); + $this->dispatch('error', 'Failed to create storage.', $e->getMessage()); } } diff --git a/app/Models/EnvironmentVariable.php b/app/Models/EnvironmentVariable.php index fafa6f30c..a3611a0c6 100644 --- a/app/Models/EnvironmentVariable.php +++ b/app/Models/EnvironmentVariable.php @@ -91,7 +91,7 @@ class EnvironmentVariable extends Model } private function get_real_environment_variables(?string $environment_variable = null, $resource = null): string|null { - if (!$environment_variable) { + if (!$environment_variable || !$resource) { return null; } $environment_variable = trim($environment_variable); diff --git a/resources/views/components/new-modal.blade.php b/resources/views/components/new-modal.blade.php index b542d77ac..6c6dcc3e3 100644 --- a/resources/views/components/new-modal.blade.php +++ b/resources/views/components/new-modal.blade.php @@ -17,19 +17,19 @@