mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 14:17:18 +00:00
refactor(redirect): replace redirect calls with redirectRoute helper for consistency
This commit is contained in:
1 parent
5d98847e49
commit
ef1abe17b8
20 files changed
+25
-25
No files matched your search
@@ -66,7 +66,7 @@ class Rollback extends Component
|
||||
return;
|
||||
}
|
||||
|
||||
return redirect()->route('project.application.deployment.show', [
|
||||
return redirectRoute($this, 'project.application.deployment.show', [
|
||||
'project_uuid' => $this->parameters['project_uuid'],
|
||||
'application_uuid' => $this->parameters['application_uuid'],
|
||||
'deployment_uuid' => $deployment_uuid,
|
||||
|
||||
@@ -39,7 +39,7 @@ class DeleteEnvironment extends Component
|
||||
if ($environment->isEmpty()) {
|
||||
$environment->delete();
|
||||
|
||||
return redirect()->route('project.show', parameters: ['project_uuid' => $this->parameters['project_uuid']]);
|
||||
return redirectRoute($this, 'project.show', ['project_uuid' => $this->parameters['project_uuid']]);
|
||||
}
|
||||
|
||||
return $this->dispatch('error', "<strong>Environment {$environment->name}</strong> has defined resources, please delete them first.");
|
||||
|
||||
@@ -35,7 +35,7 @@ class DeleteProject extends Component
|
||||
if ($project->isEmpty()) {
|
||||
$project->delete();
|
||||
|
||||
return redirect()->route('project.index');
|
||||
return redirectRoute($this, 'project.index');
|
||||
}
|
||||
|
||||
return $this->dispatch('error', "<strong>Project {$project->name}</strong> has resources defined, please delete them first.");
|
||||
|
||||
@@ -63,7 +63,7 @@ class EnvironmentEdit extends Component
|
||||
{
|
||||
try {
|
||||
$this->syncData(true);
|
||||
$this->redirectRoute('project.environment.edit', [
|
||||
redirectRoute($this, 'project.environment.edit', [
|
||||
'environment_uuid' => $this->environment->uuid,
|
||||
'project_uuid' => $this->project->uuid,
|
||||
]);
|
||||
|
||||
@@ -154,7 +154,7 @@ class DockerImage extends Component
|
||||
'fqdn' => $fqdn,
|
||||
]);
|
||||
|
||||
return redirect()->route('project.application.configuration', [
|
||||
return redirectRoute($this, 'project.application.configuration', [
|
||||
'application_uuid' => $application->uuid,
|
||||
'environment_uuid' => $environment->uuid,
|
||||
'project_uuid' => $project->uuid,
|
||||
|
||||
@@ -16,6 +16,6 @@ class EmptyProject extends Component
|
||||
'uuid' => (string) new Cuid2,
|
||||
]);
|
||||
|
||||
return redirect()->route('project.show', ['project_uuid' => $project->uuid, 'environment_uuid' => $project->environments->first()->uuid]);
|
||||
return redirectRoute($this, 'project.show', ['project_uuid' => $project->uuid, 'environment_uuid' => $project->environments->first()->uuid]);
|
||||
}
|
||||
}
|
||||
@@ -100,7 +100,7 @@ class Database extends Component
|
||||
$this->database->delete();
|
||||
$this->dispatch('success', 'Database deleted.');
|
||||
|
||||
return redirect()->route('project.service.configuration', $this->parameters);
|
||||
return redirectRoute($this, 'project.service.configuration', $this->parameters);
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
||||
@@ -164,7 +164,7 @@ class Database extends Component
|
||||
$serviceDatabase->delete();
|
||||
});
|
||||
|
||||
return redirect()->route('project.service.configuration', $redirectParams);
|
||||
return redirectRoute($this, 'project.service.configuration', $redirectParams);
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ class Destination extends Component
|
||||
return;
|
||||
}
|
||||
|
||||
return redirect()->route('project.application.deployment.show', [
|
||||
return redirectRoute($this, 'project.application.deployment.show', [
|
||||
'project_uuid' => data_get($this->resource, 'environment.project.uuid'),
|
||||
'application_uuid' => data_get($this->resource, 'uuid'),
|
||||
'deployment_uuid' => $deployment_uuid,
|
||||
|
||||
@@ -48,7 +48,7 @@ class Show extends Component
|
||||
'uuid' => (string) new Cuid2,
|
||||
]);
|
||||
|
||||
return redirect()->route('project.resource.index', [
|
||||
return redirectRoute($this, 'project.resource.index', [
|
||||
'project_uuid' => $this->project->uuid,
|
||||
'environment_uuid' => $environment->uuid,
|
||||
]);
|
||||
@@ -59,7 +59,7 @@ class Show extends Component
|
||||
|
||||
public function navigateToEnvironment($projectUuid, $environmentUuid)
|
||||
{
|
||||
return redirect()->route('project.resource.index', [
|
||||
return redirectRoute($this, 'project.resource.index', [
|
||||
'project_uuid' => $projectUuid,
|
||||
'environment_uuid' => $environmentUuid,
|
||||
]);
|
||||
|
||||
Reference in new issue
Block a user