Automatically redirect on sole result

This commit is contained in:
Ananth Venkatesh 2024-02-16 20:10:45 +00:00
parent a55c587e5b
commit 2c1f2ff882

View file

@ -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'>