Simplifying routes and making new procedures
Hey, I am making an app and I wanted to ask if there was an easier way to ensure that the user has access to the team they are redirecting to. I do this by writing a query to check if the user's id is found inside of the members object of that team. If nothing is returned then I redirect them somewhere else. I am wondering if there is a simpler way to do this, like making a teamProcedure in trpc that automatically does that every single time a procedure call is made. Any tips will help.
team/[teamId]/layout.tsx
query:
0 Replies