From 4df349f74d43ccccddc09db60c784f5289890ff2 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Thu, 17 Jul 2025 09:31:55 +0200 Subject: [PATCH] refactor(previews): streamline preview domain generation logic in ApplicationDeploymentJob for improved clarity and maintainability --- app/Jobs/ApplicationDeploymentJob.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 67043555d..07d4ea9a0 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -229,16 +229,11 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue // Set preview fqdn if ($this->pull_request_id !== 0) { - if ($this->application->build_pack === 'dockercompose') { - // For Docker Compose apps, use the preview model's compose-specific method - $this->preview = ApplicationPreview::findPreviewByApplicationAndPullId($this->application->id, $this->pull_request_id); - if ($this->preview) { + $this->preview = ApplicationPreview::findPreviewByApplicationAndPullId($this->application->id, $this->pull_request_id); + if ($this->preview) { + if ($this->application->build_pack === 'dockercompose') { $this->preview->generate_preview_fqdn_compose(); - } - } else { - // For non-Docker Compose apps, use the preview model's method - $this->preview = ApplicationPreview::findPreviewByApplicationAndPullId($this->application->id, $this->pull_request_id); - if ($this->preview) { + } else { $this->preview->generate_preview_fqdn(); } }