fix: readonly does not exists

fix: validate after setting timezone to the new value
This commit is contained in:
Andras Bacsai
2025-01-07 09:29:38 +01:00
parent fb66d05760
commit f2b62e93ce

View File

@@ -40,7 +40,7 @@ class BackupEdit extends Component
#[Validate(['required', 'string'])] #[Validate(['required', 'string'])]
public string $frequency = ''; public string $frequency = '';
#[Validate(['readonly', 'string'])] #[Validate(['string'])]
public string $timezone = ''; public string $timezone = '';
#[Validate(['required', 'integer', 'min:1'])] #[Validate(['required', 'integer', 'min:1'])]
@@ -71,7 +71,6 @@ class BackupEdit extends Component
public function syncData(bool $toModel = false) public function syncData(bool $toModel = false)
{ {
if ($toModel) { if ($toModel) {
$this->customValidate();
$this->backup->enabled = $this->backupEnabled; $this->backup->enabled = $this->backupEnabled;
$this->backup->frequency = $this->frequency; $this->backup->frequency = $this->frequency;
$this->backup->number_of_backups_locally = $this->numberOfBackupsLocally; $this->backup->number_of_backups_locally = $this->numberOfBackupsLocally;
@@ -79,6 +78,7 @@ class BackupEdit extends Component
$this->backup->s3_storage_id = $this->s3StorageId; $this->backup->s3_storage_id = $this->s3StorageId;
$this->backup->databases_to_backup = $this->databasesToBackup; $this->backup->databases_to_backup = $this->databasesToBackup;
$this->backup->dump_all = $this->dumpAll; $this->backup->dump_all = $this->dumpAll;
$this->customValidate();
$this->backup->save(); $this->backup->save();
} else { } else {
$this->backupEnabled = $this->backup->enabled; $this->backupEnabled = $this->backup->enabled;