Fix the issue with links pointing to an invalid path

This commit is contained in:
brufdev
2025-02-27 14:11:04 +00:00
parent f274ecc961
commit 9c130fd376

View File

@@ -26,15 +26,17 @@ final readonly class GetVaultNodeFromPath
->first();
}
/** @var VaultNode $node */
$node = VaultNode::query()
->where('vault_id', $vaultId)
->where('parent_id', $parentId)
->where('is_file', false)
->where('name', 'LIKE', $pieces[0])
->first();
$path = Str::after($path, '/');
return $this->handle($vaultId, $path, $node->id);
if (is_null($node)) {
return $node;
}
return $this->handle($vaultId, Str::after($path, '/'), $node->id);
}
}