Automatically redirect on sole result
This commit is contained in:
parent
a55c587e5b
commit
2c1f2ff882
1 changed files with 5 additions and 0 deletions
|
@ -112,6 +112,11 @@ export default function Page() {
|
|||
router.push(input)
|
||||
}
|
||||
|
||||
if (data.length === 1) {
|
||||
// auto redirect if only one result
|
||||
handleRedirect(`/document/view/${data[0].id}`)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='max-w-4xl mx-auto'>
|
||||
<h1 className='text-xl mb-4 p-2'>
|
||||
|
|
Loading…
Reference in a new issue