mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-13 22:15:35 +00:00
refactor(previews): move preview domain generation logic to ApplicationPreview model for better encapsulation and consistency across webhook handlers
This commit is contained in:
1 parent
8a107b3c4b
commit
5bdf2e8481
8 files changed
+42
-36
No files matched your search
@@ -236,8 +236,11 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
|
||||
$this->preview->generate_preview_fqdn_compose();
|
||||
}
|
||||
} else {
|
||||
// For non-Docker Compose apps, use the application model's method
|
||||
$this->preview = $this->application->generate_preview_fqdn($this->pull_request_id);
|
||||
// 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) {
|
||||
$this->preview->generate_preview_fqdn();
|
||||
}
|
||||
}
|
||||
if ($this->application->is_github_based()) {
|
||||
ApplicationPullRequestUpdateJob::dispatch(application: $this->application, preview: $this->preview, deployment_uuid: $this->deployment_uuid, status: ProcessStatus::IN_PROGRESS);
|
||||
|
||||
Reference in new issue
Block a user