fix: installDocker id not found

This commit is contained in:
Andras Bacsai 2023-09-18 10:44:32 +02:00
parent a386a1bde5
commit efa7cab3e2
3 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@
class InstallDocker class InstallDocker
{ {
public function __invoke(Server $server, Team $team) public function __invoke(Server $server)
{ {
$dockerVersion = '24.0'; $dockerVersion = '24.0';
$config = base64_encode('{ $config = base64_encode('{
@ -19,7 +19,7 @@ public function __invoke(Server $server, Team $team)
} }
}'); }');
$found = StandaloneDocker::where('server_id', $server->id); $found = StandaloneDocker::where('server_id', $server->id);
if ($found->count() == 0) { if ($found->count() == 0 && $server->id) {
StandaloneDocker::create([ StandaloneDocker::create([
'name' => 'coolify', 'name' => 'coolify',
'network' => 'coolify', 'network' => 'coolify',

View File

@ -232,7 +232,7 @@ public function validateServer(?string $type = null)
} }
public function installDocker() public function installDocker()
{ {
$activity = resolve(InstallDocker::class)($this->createdServer, currentTeam()); $activity = resolve(InstallDocker::class)($this->createdServer);
$this->emit('newMonitorActivity', $activity->id); $this->emit('newMonitorActivity', $activity->id);
$this->currentState = 'select-proxy'; $this->currentState = 'select-proxy';
} }

View File

@ -44,7 +44,7 @@ public function mount()
public function installDocker() public function installDocker()
{ {
$activity = resolve(InstallDocker::class)($this->server, currentTeam()); $activity = resolve(InstallDocker::class)($this->server);
$this->emit('newMonitorActivity', $activity->id); $this->emit('newMonitorActivity', $activity->id);
} }