mirror of
https://github.com/brufdev/many-notes.git
synced 2026-05-20 00:58:50 -05:00
Remove HTTP layer from action
This commit is contained in:
@@ -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,
|
||||
]);
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user