mirror of
https://github.com/brufdev/many-notes.git
synced 2026-01-07 11:30:13 -06:00
Fix the issue with links pointing to an invalid path
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user