fixes
This commit is contained in:
@@ -9,6 +9,7 @@ class Deployments extends Component
|
||||
{
|
||||
public int $application_id;
|
||||
public $deployments = [];
|
||||
public int $deployments_count = 0;
|
||||
public string $current_url;
|
||||
public int $skip = 0;
|
||||
public int $default_take = 8;
|
||||
@@ -24,15 +25,14 @@ class Deployments extends Component
|
||||
}
|
||||
public function load_deployments(int|null $take = null)
|
||||
{
|
||||
ray('Take' . $take);
|
||||
if ($take) {
|
||||
ray('Take is not null');
|
||||
$this->skip = $this->skip + $take;
|
||||
}
|
||||
|
||||
$take = $this->default_take;
|
||||
$this->deployments = Application::find($this->application_id)->deployments($this->skip, $take);
|
||||
|
||||
['deployments' => $deployments, 'count' => $count] = Application::find($this->application_id)->deployments($this->skip, $take);
|
||||
$this->deployments = $deployments;
|
||||
$this->deployments_count = $count;
|
||||
if (count($this->deployments) !== 0 && count($this->deployments) < $take) {
|
||||
$this->show_next = false;
|
||||
return;
|
||||
|
||||
@@ -37,7 +37,6 @@ class Form extends Component
|
||||
{
|
||||
$this->validate();
|
||||
$this->application->preview_url_template = str_replace(' ', '', $this->application->preview_url_template);
|
||||
ray($this->application->preview_url_template);
|
||||
$this->application->save();
|
||||
$this->generate_real_url();
|
||||
}
|
||||
|
||||
@@ -41,12 +41,12 @@ class Previews extends Component
|
||||
$this->rate_limit_remaining = $rate_limit_remaining;
|
||||
$this->pull_requests = $data->sortBy('number')->values();
|
||||
}
|
||||
public function deploy(int $pull_request_id, string|null $pull_request_html_url)
|
||||
public function deploy(int $pull_request_id, string|null $pull_request_html_url = null)
|
||||
{
|
||||
try {
|
||||
$this->set_deployment_uuid();
|
||||
$found = ApplicationPreview::where('application_id', $this->application->id)->where('pull_request_id', $pull_request_id)->first();
|
||||
if (!$found) {
|
||||
if (!$found && !is_null($pull_request_html_url)) {
|
||||
ApplicationPreview::create([
|
||||
'application_id' => $this->application->id,
|
||||
'pull_request_id' => $pull_request_id,
|
||||
|
||||
Reference in New Issue
Block a user