refactor: replace queries with cached versions for performance improvements

This commit is contained in:
Andras Bacsai
2025-12-08 13:39:33 +01:00
parent bb83f4e5c3
commit 5e8d11f732
28 changed files with 305 additions and 125 deletions
@@ -36,7 +36,7 @@ class ResourceOperations extends Component
$parameters = get_route_parameters();
$this->projectUuid = data_get($parameters, 'project_uuid');
$this->environmentUuid = data_get($parameters, 'environment_uuid');
$this->projects = Project::ownedByCurrentTeam()->get();
$this->projects = Project::ownedByCurrentTeamCached();
$this->servers = currentTeam()->servers->filter(fn ($server) => ! $server->isBuildServer());
}
@@ -72,7 +72,7 @@ class Show extends Component
} elseif ($service_uuid) {
$this->type = 'service';
$this->service_uuid = $service_uuid;
$this->resource = Service::ownedByCurrentTeam()->where('uuid', $service_uuid)->firstOrFail();
$this->resource = Service::ownedByCurrentTeamCached()->where('uuid', $service_uuid)->firstOrFail();
}
$this->parameters = [
'environment_uuid' => $environment_uuid,