fix: revert some more for less confusion

This commit is contained in:
David Buday 2024-11-08 18:12:28 +01:00
parent 5187324b03
commit 3130b44340

View file

@ -55,19 +55,17 @@ class DockerImage extends Component
'latest';
$destination_uuid = $this->query['destination'];
$destination = StandaloneDocker::where('uuid', $destination_uuid)->first()
?? SwarmDocker::where('uuid', $destination_uuid)->first();
if (!$destination) {
throw new \Exception('Destination not found.');
$destination = StandaloneDocker::where('uuid', $destination_uuid)->first();
if (! $destination) {
$destination = SwarmDocker::where('uuid', $destination_uuid)->first();
}
if (! $destination) {
throw new \Exception('Destination not found. What?!');
}
$destination_class = $destination->getMorphClass();
$project = Project::where('uuid', $this->parameters['project_uuid'])->first();
$environment = $project->load(['environments'])
->environments
->where('name', $this->parameters['environment_name'])
->first();
$environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first();
$application = Application::create([
'name' => 'docker-image-'.new Cuid2,