refactor(previews): move preview domain generation logic to ApplicationPreview model for better encapsulation and consistency across webhook handlers

This commit is contained in:
Andras Bacsai
2025-07-14 19:12:57 +02:00
parent 8a107b3c4b
commit 5bdf2e8481
8 changed files with 42 additions and 36 deletions

View File

@@ -86,7 +86,7 @@ class Previews extends Component
return;
}
$this->application->generate_preview_fqdn($preview->pull_request_id);
$preview->generate_preview_fqdn();
$this->application->refresh();
$this->dispatch('update_links');
$this->dispatch('success', 'Domain generated.');
@@ -118,7 +118,7 @@ class Previews extends Component
'pull_request_html_url' => $pull_request_html_url,
]);
}
$this->application->generate_preview_fqdn($pull_request_id);
$found->generate_preview_fqdn();
$this->application->refresh();
$this->dispatch('update_links');
$this->dispatch('success', 'Preview added.');