OutisO
tRPC4y ago
6 replies
Outis

Can I redirect the user from inside my router?

I have a query protectedProcedure, which returns an object from my prisma planetscale db

What's the best way to redirect the user to a 404 page if the item doesn't exist on the db? I wanted something like
res.redirect("/404")
but can't seem to find a way to do it

Should I just handle it in the front-end with a useEffect?
Was this page helpful?