Remove HTTP layer from action

This commit is contained in:
brufdev
2025-04-20 16:29:10 +01:00
parent c981f52a99
commit 6afd98e282
2 changed files with 3 additions and 5 deletions
+2 -4
View File
@@ -11,13 +11,11 @@ use ZipArchive;
final readonly class ProcessImportedVault
{
public function handle(string $fileName, string $filePath): void
public function handle(User $user, string $fileName, string $filePath): void
{
/** @var User $currentUser */
$currentUser = auth()->user();
$nodeIds = ['.' => null];
$vaultName = pathinfo($fileName, PATHINFO_FILENAME);
$vault = new CreateVault()->handle($currentUser, [
$vault = new CreateVault()->handle($user, [
'name' => $vaultName,
]);
+1 -1
View File
@@ -40,7 +40,7 @@ final class ImportVault extends Component
$fileName = $file->getClientOriginalName();
$filePath = $file->getRealPath();
new ProcessImportedVault()->handle($fileName, $filePath);
new ProcessImportedVault()->handle($user, $fileName, $filePath);
$this->closeModal();
$this->dispatch('toast', message: __('Vault imported'), type: 'success');