fix: file/dir based volumes are now read from the server

This commit is contained in:
Andras Bacsai
2023-09-29 21:38:11 +02:00
parent 23e205b6cd
commit 64ce41df0f
9 changed files with 91 additions and 34 deletions

View File

@@ -33,12 +33,20 @@ class FileStorage extends Component
}
public function submit()
{
$original = $this->fileStorage->getOriginal();
try {
$this->validate();
if ($this->fileStorage->is_directory) {
$this->fileStorage->content = null;
}
$this->fileStorage->save();
$this->service->saveFileVolumes();
$this->fileStorage->saveStorageOnServer($this->service);
// ray($this->fileStorage);
// $this->service->saveFileVolumes();
$this->emit('success', 'File updated successfully.');
} catch (\Throwable $e) {
$this->fileStorage->setRawAttributes($original);
$this->fileStorage->save();
return handleError($e, $this);
}
}