commit
469e009600
1 changed files with 5 additions and 3 deletions
|
|
@ -21,8 +21,8 @@ class CreateScheduledBackup extends Component
|
||||||
|
|
||||||
public bool $enabled = true;
|
public bool $enabled = true;
|
||||||
|
|
||||||
#[Validate(['required', 'integer'])]
|
#[Validate(['nullable', 'integer'])]
|
||||||
public int $s3StorageId;
|
public ?int $s3StorageId = null;
|
||||||
|
|
||||||
public Collection $definedS3s;
|
public Collection $definedS3s;
|
||||||
|
|
||||||
|
|
@ -49,6 +49,7 @@ public function submit()
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$payload = [
|
$payload = [
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
'frequency' => $this->frequency,
|
'frequency' => $this->frequency,
|
||||||
|
|
@ -58,6 +59,7 @@ public function submit()
|
||||||
'database_type' => $this->database->getMorphClass(),
|
'database_type' => $this->database->getMorphClass(),
|
||||||
'team_id' => currentTeam()->id,
|
'team_id' => currentTeam()->id,
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($this->database->type() === 'standalone-postgresql') {
|
if ($this->database->type() === 'standalone-postgresql') {
|
||||||
$payload['databases_to_backup'] = $this->database->postgres_db;
|
$payload['databases_to_backup'] = $this->database->postgres_db;
|
||||||
} elseif ($this->database->type() === 'standalone-mysql') {
|
} elseif ($this->database->type() === 'standalone-mysql') {
|
||||||
|
|
@ -72,11 +74,11 @@ public function submit()
|
||||||
} else {
|
} else {
|
||||||
$this->dispatch('refreshScheduledBackups');
|
$this->dispatch('refreshScheduledBackups');
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
} finally {
|
} finally {
|
||||||
$this->frequency = '';
|
$this->frequency = '';
|
||||||
$this->saveToS3 = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue