Refactor storage connection handling and project

initialization
This commit is contained in:
Andras Bacsai
2023-11-15 09:34:27 +01:00
parent 1f711d9281
commit b825d98b2d
7 changed files with 9 additions and 23 deletions

View File

@@ -64,21 +64,10 @@ class Create extends Component
}
$this->storage->team_id = currentTeam()->id;
$this->storage->testConnection();
$this->storage->is_usable = true;
$this->storage->save();
return redirect()->route('team.storages.show', $this->storage->uuid);
} catch (\Throwable $e) {
return handleError($e, $this);
}
}
private function test_s3_connection()
{
try {
$this->storage->testConnection();
return $this->emit('success', 'Connection is working. Tested with "ListObjectsV2" action.');
} catch (\Throwable $e) {
return handleError($e, $this);
}
}
}