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'])]
public string $frequency = '';
#[Validate(['readonly', 'string'])]
#[Validate(['string'])]
public string $timezone = '';
#[Validate(['required', 'integer', 'min:1'])]
@@ -71,7 +71,6 @@ class BackupEdit extends Component
public function syncData(bool $toModel = false)
{
if ($toModel) {
$this->customValidate();
$this->backup->enabled = $this->backupEnabled;
$this->backup->frequency = $this->frequency;
$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->databases_to_backup = $this->databasesToBackup;
$this->backup->dump_all = $this->dumpAll;
$this->customValidate();
$this->backup->save();
} else {
$this->backupEnabled = $this->backup->enabled;
@@ -187,12 +187,12 @@ class BackupEdit extends Component
private function deleteAssociatedBackupsS3()
{
//Add function to delete backups from S3
// Add function to delete backups from S3
}
private function deleteAssociatedBackupsSftp()
{
//Add function to delete backups from SFTP
// Add function to delete backups from SFTP
}
private function deleteEmptyBackupFolder($folderPath, $server)